我试图将我的django-cms项目从django-cms 3.1.0升级到3.1.2并将django 1.7.1升级到django 1.8.3,但是当我在终端中运行python manage.py runserver
时出现此错误:
File "/home/testacc/projects/test/env/local/lib/python2.7/site-packages/cms/utils/setup.py", line 33, in validate_settings raise ImproperlyConfigured("django CMS requires django.template.context_processors.request in " django.core.exceptions.ImproperlyConfigured: django CMS requires django.template.context_processors.request in 'django.template.backends.django.DjangoTemplates' context processors.
答案 0 :(得分:12)
在Django 1.8中TEMPLATE_CONTEXT_PROCESSORS deprecated. 在settings.py中使用它:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'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',
'sekizai.context_processors.sekizai',
'cms.context_processors.cms_settings',
)
}
},
]