Custom http error classes for Django
$ pip install -e git://github.com/numerodix/django-http-errors.git#egg=django-http-errors
Then add:
INSTALLED_APPS = (
..
'http_errors',
..
)
MIDDLEWARE_CLASSES = (
..
'http_errors.middleware.HandleHttpErrorsMiddleware',
..
)
from http_errors.http import Http302
def some_view(request):
raise Http302('http://some/url')