fabiocaccamo/django-redirects

:arrow_right_hook: :white_check_mark: redirects as they should be, with full control.

301
302
303
307
308
410
admin
counter
django
exact
gone
middleware
prefix
redirect
redirects
regex
site
status-code

django-redirects

django-redirects fills the gap of django.contrib.redirects offering redirects with full control.

Features

  • Sites framework support.
  • Custom redirect type: 301, 302, 303, 307, 308.
  • Custom redirect match condition: EXACT, PREFIX or REGEX.
  • Regex support, match and replace groups using group reference: $1, $2, $3, ...
  • Counter to monitor requests count handled by each redirect.
  • Admin integration with list filters and the possibility to test the redirect.

Installation

  • Run pip install django-redirects.
  • Add redirects to settings.INSTALLED_APPS.
  • Add redirects.middleware.RedirectMiddleware to settings.MIDDLEWARE before other middlewares.
  • Run python manage.py migrate.
  • Restart your application server.

Testing

# clone repository
git clone https://github.com/fabiocaccamo/django-redirects.git && cd django-redirects

# create virtualenv and activate it
python -m venv venv && . venv/bin/activate

# upgrade pip
python -m pip install --upgrade pip

# install requirements
pip install -r requirements.txt -r requirements-test.txt

# install pre-commit to run formatters and linters
pre-commit install --install-hooks

# run tests
tox
# or
python runtests.py
# or
python -m django test --settings "tests.settings"

License

Released under MIT License.

Supporting

  • :star: Star this project on GitHub
  • :octocat: Follow me on GitHub
  • :blue_heart: Follow me on Twitter
  • :moneybag: Sponsor me on Github

See also

  • django-admin-interface - the default admin interface made customizable by the admin itself. popup windows replaced by modals. ๐Ÿง™ โšก

  • django-cache-cleaner - clear the entire cache or individual caches easily using the admin panel or management command. ๐Ÿงนโœจ

  • django-colorfield - simple color field for models with a nice color-picker in the admin. ๐ŸŽจ

  • django-extra-settings - config and manage typed extra settings using just the django admin. โš™๏ธ

  • django-maintenance-mode - shows a 503 error page when maintenance-mode is on. ๐Ÿšง ๐Ÿ› ๏ธ

  • django-treenode - probably the best abstract model / admin for your tree based stuff. ๐ŸŒณ

  • python-benedict - dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. ๐Ÿ“˜

  • python-codicefiscale - encode/decode Italian fiscal codes - codifica/decodifica del Codice Fiscale. ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ’ณ

  • python-fontbro - friendly font operations. ๐Ÿงข

  • python-fsutil - file-system utilities for lazy devs. ๐ŸงŸโ€โ™‚๏ธ

Stars
60
100.00% more than last month
Forks
3
Open Issues
2