Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

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*.
Release History

Release History

This version
History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-ajax-redirection-1.0.0.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source Mar 27, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting