reviewboard.site.middleware¶
Middleware for Local Sites.
- 
class 
LocalSiteMiddleware[source]¶ Bases:
objectMiddleware that handles storing information on the Local Site in use.
This adds a new
local_siteattribute to theHttpRequestthat, when first accessed, will fetch and cache the matchingLocalSite. If there’s no Local Site for this given request, this will storeNoneinstead.- 
process_view(request, view_func, view_args, view_kwargs)[source]¶ Process the request before calling the view.
This sets up a
local_siteattribute on the request to fetch theLocalSiteused for this view, if any. This is based on thelocal_site_namekey inview_kwargs.Parameters: - request (django.http.HttpRequest) – The HTTP request from the client.
 - view_func (callable) – The view being called. This is unused.
 - view_args (tuple) – The positional arguments passed to the view. This is unused.
 - view_kwargs (dict) – The keyword arguments passed to the view.
 
-