Skip to main content

django redirects as they should be, with full control.

Project description


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


  • 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.


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


# clone repository
git clone && 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
# or
# or
python -m django test --settings "tests.settings"


Released under MIT License.


  • :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-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. 🧟‍♂️

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-redirects-0.6.0.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

django_redirects-0.6.0-py3-none-any.whl (17.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page