ImproperlyConfigured Enable 'django.contrib.auth.context_processors.auth' in your TEMPLATES setting in order to use the admin application.

Raised by:

django/contrib/admin/sites.py (line 194)

Traceback (most recent call last):
  File "python2.7/site-packages/django/core/handlers/base.py", line 119, in get_response
    resolver_match = resolver.resolve(request.path_info)
  File "python2.7/site-packages/django/core/urlresolvers.py", line 366, in resolve
    for pattern in self.url_patterns:
  File "python2.7/site-packages/django/core/urlresolvers.py", line 402, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "python2.7/site-packages/django/core/urlresolvers.py", line 396, in urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "private.py", line 1, in private_function
    private_function()
  File "private.py", line 1, in private_function
    private_function()
  File "python2.7/site-packages/django/contrib/admin/sites.py", line 291, in urls
    return self.get_urls(), 'admin', self.name
  File "python2.7/site-packages/django/contrib/admin/sites.py", line 250, in get_urls
    self.check_dependencies()
  File "python2.7/site-packages/django/contrib/admin/sites.py", line 194, in check_dependencies
    "Enable 'django.contrib.auth.context_processors.auth' "
ImproperlyConfigured: Enable 'django.contrib.auth.context_processors.auth' in your TEMPLATES setting in order to use the admin application.

How to reproduce

Remove 'django.contrib.auth.context_processors.auth' from the context_processors in the TEMPLATES setting variable.

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                # "django.contrib.auth.context_processors.auth",
                "django.template.context_processors.debug",
                "django.template.context_processors.i18n",
                "django.template.context_processors.media",
                "django.template.context_processors.static",
                "django.template.context_processors.tz",
                "django.contrib.messages.context_processors.messages"
            ],
        },
    },
]]

How to fix

Add "django.contrib.auth.context_processors.auth" to the context_processors.

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                "django.contrib.auth.context_processors.auth",
                ...
            ],
        },
    },
]