2014-01-05 05:49:35 +08:00
|
|
|
from django.apps import AppConfig
|
2014-01-25 05:43:00 +08:00
|
|
|
from django.core import checks
|
|
|
|
from django.contrib.admin.checks import check_admin_app
|
2014-01-05 05:49:35 +08:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
|
|
|
|
2014-01-25 05:43:00 +08:00
|
|
|
class SimpleAdminConfig(AppConfig):
|
|
|
|
"""Simple AppConfig which does not do automatic discovery."""
|
|
|
|
|
2014-01-05 05:49:35 +08:00
|
|
|
name = 'django.contrib.admin'
|
2014-03-06 23:03:25 +08:00
|
|
|
verbose_name = _("Administration")
|
2014-01-19 02:34:54 +08:00
|
|
|
|
|
|
|
def ready(self):
|
2014-04-10 20:45:48 +08:00
|
|
|
checks.register(checks.Tags.admin)(check_admin_app)
|
2014-01-25 05:43:00 +08:00
|
|
|
|
|
|
|
|
|
|
|
class AdminConfig(SimpleAdminConfig):
|
|
|
|
"""The default AppConfig for admin which does autodiscovery."""
|
|
|
|
|
|
|
|
def ready(self):
|
|
|
|
super(AdminConfig, self).ready()
|
2014-01-19 02:34:54 +08:00
|
|
|
self.module.autodiscover()
|