admin.AdminSite.login_form

AdminSite.login_form Subclass of AuthenticationForm that will be used by the admin site login view.

admin.AdminSite.index_title

AdminSite.index_title The text to put at the top of the admin index page (a string). By default, this is “Site administration”.

admin.AdminSite.index_template

AdminSite.index_template Path to a custom template that will be used by the admin site main index view.

admin.AdminSite.has_permission()

AdminSite.has_permission(request) [source] Returns True if the user for the given HttpRequest has permission to view at least one page in the admin site. Defaults to requiring both User.is_active and User.is_staff to be True.

admin.AdminSite.empty_value_display

AdminSite.empty_value_display New in Django 1.9. The string to use for displaying empty values in the admin site’s change list. Defaults to a dash. The value can also be overridden on a per ModelAdmin basis and on a custom field within a ModelAdmin by setting an empty_value_display attribute on the field. See ModelAdmin.empty_value_display for examples.

admin.AdminSite.each_context()

AdminSite.each_context(request) [source] Returns a dictionary of variables to put in the template context for every page in the admin site. Includes the following variables and values by default: site_header: AdminSite.site_header site_title: AdminSite.site_title site_url: AdminSite.site_url has_permission: AdminSite.has_permission() available_apps: a list of applications from the application registry available for the current user. Each entry in the list is a dict representing an a

admin.AdminSite.disable_action()

AdminSite.disable_action(name) [source] If you need to disable a site-wide action you can call AdminSite.disable_action(). For example, you can use this method to remove the built-in “delete selected objects” action: admin.site.disable_action('delete_selected') Once you’ve done the above, that action will no longer be available site-wide. If, however, you need to re-enable a globally-disabled action for one particular model, simply list it explicitly in your ModelAdmin.actions list: # Globa

admin.AdminSite.app_index_template

AdminSite.app_index_template Path to a custom template that will be used by the admin site app index view.

admin.AdminSite.add_action()

AdminSite.add_action(action, name=None) [source] Some actions are best if they’re made available to any object in the admin site – the export action defined above would be a good candidate. You can make an action globally available using AdminSite.add_action(). For example: from django.contrib import admin admin.site.add_action(export_selected_objects) This makes the export_selected_objects action globally available as an action named “export_selected_objects”. You can explicitly give the

admin.AdminSite

class AdminSite(name='admin') [source] A Django administrative site is represented by an instance of django.contrib.admin.sites.AdminSite; by default, an instance of this class is created as django.contrib.admin.site and you can register your models and ModelAdmin instances with it. When constructing an instance of an AdminSite, you can provide a unique instance name using the name argument to the constructor. This instance name is used to identify the instance, especially when reversing adm