我有django 1.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" %}
{% extends "admin/base.html" %}
{% load admin_static %}{% load suit_tags %}
{% block branding %} {% endblock branding %}
我的模板设置:
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',
]
答案 0 :(得分:0)
自述文件中的installation instructions表示.
应该是django_mobile.loader.Loader
中的第一个项,例如:
loaders
目前,你最终拥有它,所以Django将首先尝试使用其他装载机。