Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Useful wrappers/middleware for django

Project description

# Ajax redirection middleware for Django

[![Build Status](](
[![Code Health](](

## What this?
This is a collection of useful middlware for Django with Ajax.
For example, [AngularJS]( has URL routing subsystem,
which uses AJAX. In addition, it supports history push state. This mean, when
you access the website with ``````, the addressbar
shows ``````. However, accessing
``````, you will get 404, because the HTTP request
is sent to ``````, not ``````.
To avoid this problem, we should redirect the route to
``````, when accessing ``````.

This module provides middleware to avoid the problem.

## How to use
### Middleware
1. Add ```dj_ajax_redirect.middleware.AjaxRedirectionMiddleware```
to ```MIDDLEWARE_CLASSES``` on your setting.

## Disable redirection
### Middleware
Just add a new item named "DISABLE_REDIRECT", of which type is list. i.e. just like this:


Note that static files are already added to disable list. Therefore, you don't need to add
static urls.

In addition, *the strings are treated as regexp-s*.

Project details

Release history Release notifications

Download files

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

Files for django-ajax-redirection, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size django-ajax-redirection-1.0.0.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page