subdomains.middleware¶
-
class
subdomains.middleware.SubdomainMiddleware¶ A middleware class that adds a
subdomainattribute to the current request.-
get_domain_for_request(request)¶ Returns the domain that will be used to identify the subdomain part for this request.
-
process_request(request)¶ Adds a
subdomainattribute to therequestparameter.
-
-
class
subdomains.middleware.SubdomainURLRoutingMiddleware¶ A middleware class that allows for subdomain-based URL routing.
-
process_request(request)¶ Sets the current request’s
urlconfattribute to the urlconf associated with the subdomain, if it is listed insettings.SUBDOMAIN_URLCONFS.
-
process_response(request, response)¶ Forces the HTTP
Varyheader onto requests to avoid having responses cached across subdomains.
-