# Ajax redirection middleware for Django
## What this?
This is a collection of useful middlware for Django with Ajax.
For example, [AngularJS](https://angularjs.org/) has URL routing subsystem,
which uses AJAX. In addition, it supports history push state. This mean, when
you access the website with ```https://example.com/#/login```, the addressbar
shows ```https://example.com/login```. However, accessing
```https://example.com/login```, you will get 404, because the HTTP request
is sent to ```https://example.com/login```, not ```https://example.com/#/login```.
To avoid this problem, we should redirect the route to
```https://example.com/#/login```, when accessing ```https://example.com/login```.
This module provides middleware to avoid the problem.
## How to use
1. Add ```dj_ajax_redirect.middleware.AjaxRedirectionMiddleware```
to ```MIDDLEWARE_CLASSES``` on your setting.
## Disable redirection
Just add a new item named "DISABLE_REDIRECT", of which type is list. i.e. just like this:
DISABLE_REDIRECT = [
Note that static files are already added to disable list. Therefore, you don't need to add
In addition, *the strings are treated as regexp-s*.
TODO: Brief introduction on what you do with files - including link to relevant help section.