diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index 81e43a1..5aa26fb 100644
a
|
b
|
class AdminSite(object):
|
402 | 402 | 'app_list': [app_dict] |
403 | 403 | }, context_instance=template.RequestContext(request)) |
404 | 404 | |
| 405 | def get_adminsite_class(import_path): |
| 406 | try: |
| 407 | dot = import_path.rindex('.') |
| 408 | except ValueError: |
| 409 | raise ImproperlyConfigured("%s isn't a adminsite class." % import_path) |
| 410 | module, classname = import_path[:dot], import_path[dot+1:] |
| 411 | try: |
| 412 | mod = __import__(module, {}, {}, ['']) |
| 413 | except ImportError, e: |
| 414 | raise ImproperlyConfigured('Error importing module %s: "%s"' % (module, e)) |
| 415 | try: |
| 416 | return getattr(mod, classname) |
| 417 | except AttributeError: |
| 418 | raise ImproperlyConfigured('The module "%s" does not define a "%s" class.' % (module, classname)) |
| 419 | |
| 420 | default_adminsite = get_adminsite_class( getattr(settings, |
| 421 | 'DEFAULT_ADMIN_SITE', 'django.contrib.admin.sites.AdminSite') ) |
| 422 | |
405 | 423 | # This global object represents the default admin site, for the common case. |
406 | 424 | # You can instantiate AdminSite in your own code to create a custom admin site. |
407 | | site = AdminSite() |
| 425 | site = default_adminsite() |