我有django1.11.2,我安装了django mobile=0.7.0。在
当我想转到管理面板时,我收到一个错误:
ExtendsError at /admin/
Cannot extend templates recursively when using non-recursive template loaders
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.11.2
Exception Type: ExtendsError
Exception Value:
Cannot extend templates recursively when using non-recursive template loaders
我在第一行收到一个错误{% extends "admin/base.html" %}
我的模板设置:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': False,
'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.template.context_processors.csrf',
'django.template.context_processors.request',
'django.contrib.messages.context_processors.messages',
'django_mobile.context_processors.flavour',
],
'loaders': (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader',
'django_mobile.loader.Loader',
),
'debug': DEBUG,
},
},
]
TEMPLATE_LOADERS = TEMPLATES[0]['OPTIONS']['loaders']
中间件类:
MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django_mobile.middleware.MobileDetectionMiddleware',
'django_mobile.middleware.SetFlavourMiddleware',
]
自述文件中的installation instructions表示
django_mobile.loader.Loader
应该是loaders
中的第一个项,例如:目前,您已经在最后,所以Django将首先尝试使用其他加载程序。在
相关问题 更多 >
编程相关推荐