MCPcopy
hub / github.com/django/django / each_context

Method each_context

django/contrib/admin/sites.py:328–349  ·  view source on GitHub ↗

Return a dictionary of variables to put in the template context for *every* page in the admin site. For sites running on a subpath, use the SCRIPT_NAME value if site_url hasn't been customized.

(self, request)

Source from the content-addressed store, hash-verified

326 return self.get_urls(), "admin", self.name
327
328 def each_context(self, request):
329 """
330 Return a dictionary of variables to put in the template context for
331 *every* page in the admin site.
332
333 For sites running on a subpath, use the SCRIPT_NAME value if site_url
334 hasn't been customized.
335 """
336 script_name = request.META["SCRIPT_NAME"]
337 site_url = (
338 script_name if self.site_url == "/" and script_name else self.site_url
339 )
340 return {
341 "site_title": self.site_title,
342 "site_header": self.site_header,
343 "site_url": site_url,
344 "has_permission": self.has_permission(request),
345 "available_apps": self.get_app_list(request),
346 "is_popup": False,
347 "is_nav_sidebar_enabled": self.enable_nav_sidebar,
348 "log_entries": self.get_log_entries(request),
349 }
350
351 def password_change(self, request, extra_context=None):
352 """

Callers 15

password_changeMethod · 0.95
password_change_doneMethod · 0.95
logoutMethod · 0.95
loginMethod · 0.95
indexMethod · 0.95
app_indexMethod · 0.95
user_change_passwordMethod · 0.80
dispatchMethod · 0.80
get_context_dataMethod · 0.80
_changeform_viewMethod · 0.80
changelist_viewMethod · 0.80
_delete_viewMethod · 0.80

Calls 3

has_permissionMethod · 0.95
get_app_listMethod · 0.95
get_log_entriesMethod · 0.95

Tested by 3

setUpMethod · 0.64