django.core.exceptions.ImproperlyConfigured: Enable 'django.contrib.auth.context_processors.auth'

codyc4321

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

ozgur

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",
            ]
        }
    }
]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Django - ImproperlyConfigured: Module "django.contrib.auth.middleware"

django.core.exceptions.ImproperlyConfigured: Requested setting AUTH_USER_MODEL, but settings are not configured

django.core.exceptions.ImproperlyConfigured

Django.core.exceptions.ImproperlyConfigured:

Q: Django ImproperlyConfigured - from django.contrib.auth.models import User

django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'app.User' that has not been installed

django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'User.User' that has not been installed

django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'authentication.User' that has not been installed

Django Installed app and ImproperlyConfigured Error: django.core.exceptions.ImproperlyConfigured

Issue in django.core.exceptions.ImproperlyConfigured

authenticate() function not working django.contrib.auth

Python | Docker | Django | django.core.exceptions.ImproperlyConfigured Error

How to fix the error for django 'django.core.exceptions.ImproperlyConfigured' with urls?

Django Celery scheduled task django.core.exceptions.ImproperlyConfigured

django.core.exceptions.ImproperlyConfigured: Django 3.0.1 is not supported

Django channels pytest testing. django.core.exceptions.ImproperlyConfigured. .

Django cannot import login from django.contrib.auth.views

Where is django.contrib.auth.User defined in Django source code

How to change Django default message in django.contrib.auth.form

django.core.exceptions.ValidationError: ["'_auth_user_id' value must be an integer."] error on Django

django.core.exceptions.ImproperlyConfigured: Field name `id` is not valid for model

django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG

django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded

django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library

"django.core.exceptions.ImproperlyConfigured:" while doing migrations to posgreSQL

Why isn't django.contrib.auth.authenticate() working here?

Reference 'django.contrib.auth.urls' to custom specific templates

django.contrib.auth.views.login returns Anonymous user

django.contrib.auth.login() function not returning any user as logged in