Skip to main content

django redirects as they should be, with full control.

Project description

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

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.9.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_redirects-0.9.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file django_redirects-0.9.0.tar.gz.

File metadata

  • Download URL: django_redirects-0.9.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_redirects-0.9.0.tar.gz
Algorithm Hash digest
SHA256 276906da5f043a0fab9de2afd27eb3cc7c423eade4b3745ad118ea5a2c8bc770
MD5 0e45151f6bce060e2451e6dfca3bc282
BLAKE2b-256 032fdf9151cfe4ef86351984a63c7e014a3abef1a031f07c94077c0a90bdc27f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_redirects-0.9.0.tar.gz:

Publisher: create-release.yml on fabiocaccamo/django-redirects

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_redirects-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_redirects-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ffea8d3b8aefd200709641875d68dfcaea2cfaab684e7abcdad62ce2aae686e
MD5 1d91d0c46230caece720b061a62aafb7
BLAKE2b-256 2904380ac27827533d478526a9a028a76095691c421d548c3f7ae3835ec193c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_redirects-0.9.0-py3-none-any.whl:

Publisher: create-release.yml on fabiocaccamo/django-redirects

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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