6

I started a new project and am getting:

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

I followed the django docs for 1.9:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
    }
]

What could be the issue (how does it want me configure)? Thank you

codyc4321
  • 9,014
  • 22
  • 92
  • 165
  • http://stackoverflow.com/questions/6099330/django-template-context-processors-breaking-my-app – ahmed Jan 26 '16 at 01:41
  • http://stackoverflow.com/questions/30005127/django-admin-breaks-after-upgrading-to-1-8-1 – ahmed Jan 26 '16 at 01:41

1 Answers1

13

You need to add it into context_processors list in the OPTIONS:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                "django.contrib.auth.context_processors.auth",
            ]
        }
    }
]
Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119
  • Actually, it does. Here is the [link](https://docs.djangoproject.com/en/1.9/topics/templates/#module-django.template.backends.django) to the section explaining that. – Ozgur Vatansever Jan 26 '16 at 01:48