Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-admin-tools Raises ImproperlyConfigured

I installed and configured as told in quickstart guide of django-admin-tools. Those are settings.py lines:

# INSTALLED APPS
'admin_tools',
'admin_tools.theming',
'admin_tools.menu',
'admin_tools.dashboard',
'django.contrib.sites',

And I also included admin_tools.template_loaders.Loader into TEMPLATES variable as told in guide as below:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'admin_tools.template_loaders.Loader',
            ],
        },
    },
]

However, it still raises ImproperlyConfigured exception as below:

django.core.exceptions.ImproperlyConfigured: You must add the "admin_tools.template_loaders.Loader" template loader to your TEMPLATES settings variable

I did not understand.

Environment

  • python 3.4.x
  • django 1.8.7
like image 259
Eray Erdin Avatar asked Oct 30 '25 11:10

Eray Erdin


1 Answers

You have added it to the list of context processors, you should have added it to the list of loaders instead:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
            'loaders': [
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
                'admin_tools.template_loaders.Loader',
            ],
        },
    },
]

See the documentation for DjangoTemplates for more information about each OPTION.

like image 112
Andrea Corbellini Avatar answered Nov 01 '25 00:11

Andrea Corbellini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!