我按照django-admin-tools的快速入门指南中的说明进行了安装和配置。这些是settings.py
行:
# INSTALLED APPS
'admin_tools',
'admin_tools.theming',
'admin_tools.menu',
'admin_tools.dashboard',
'django.contrib.sites',
而且我还按照指南中的说明将其包含admin_tools.template_loaders.Loader
在TEMPLATES
变量中,如下所示:
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',
],
},
},
]
但是,它仍然会引发ImproperlyConfigured
如下异常:
django.core.exceptions.ImproperlyConfigured: You must add the "admin_tools.template_loaders.Loader" template loader to your TEMPLATES settings variable
我不明白。
环境
- 蟒蛇3.4.x
- django 1.8.7