Jump to >


Middleware for HTTP-related processing.

class AbsoluteURLRedirectMiddleware(get_response=None)[source]

Bases: django.utils.deprecation.MiddlewareMixin

Middleware that turns all relative URL redirects to absolute.

Django 1.9 changed URL redirects to be relative by default (so long as they’re redirecting to the same host). For compatibility across Django versions (and to theoretically work around some broken HTTP implementations out in the wild), this middleware will turn those relative URLs back into absolute URLs.

process_response(request, response)[source]

Process the HTTP response.

If a relative redirect was returned, this will make it absolute.


The resulting HTTP response.

Return type


__annotations__ = {}