mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #21712 -- Moved autodiscover() to AdminConfig.ready().
Thanks Marc Tamlyn for the initial version of the patch.
This commit is contained in:
@@ -30,7 +30,7 @@ ALLOWED_HOSTS = []
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.admin',
|
||||
'django.contrib.admin.apps.AdminConfig',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from django.conf.urls import patterns, include, url
|
||||
|
||||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Examples:
|
||||
|
||||
@@ -6,3 +6,6 @@ from django.utils.translation import ugettext_lazy as _
|
||||
class AdminConfig(AppConfig):
|
||||
name = 'django.contrib.admin'
|
||||
verbose_name = _("administration")
|
||||
|
||||
def ready(self):
|
||||
self.module.autodiscover()
|
||||
|
||||
@@ -161,8 +161,8 @@ class AdminSite(object):
|
||||
installed, as well as the auth context processor.
|
||||
"""
|
||||
if not apps.is_installed('django.contrib.admin'):
|
||||
raise ImproperlyConfigured("Put 'django.contrib.admin' in your "
|
||||
"INSTALLED_APPS setting in order to use the admin application.")
|
||||
raise ImproperlyConfigured("Put 'django.contrib.admin.apps.AdminConfig' in "
|
||||
"your INSTALLED_APPS setting in order to use the admin application.")
|
||||
if not apps.is_installed('django.contrib.contenttypes'):
|
||||
raise ImproperlyConfigured("Put 'django.contrib.contenttypes' in "
|
||||
"your INSTALLED_APPS setting in order to use the admin application.")
|
||||
|
||||
Reference in New Issue
Block a user