python – ImportError:没有名为context_processors的模块
发布时间:2020-12-20 12:33:28 所属栏目:Python 来源:网络整理
导读:我在我的 django项目中运行命令: – $python manage.py runserver 然后我得到的错误如下: – from django.core.context_processors import csrfImportError: No module named context_processors 这是结果 $pip freezedj-database-url==0.4.1dj-static==0.
我在我的
django项目中运行命令: –
$python manage.py runserver 然后我得到的错误如下: – from django.core.context_processors import csrf ImportError: No module named context_processors 这是结果 $pip freeze dj-database-url==0.4.1 dj-static==0.0.6 Django==1.10 django-toolbelt==0.0.1 gunicorn==19.6.0 pkg-resources==0.0.0 psycopg2==2.6.2 static3==0.7.0 和 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',],},] 我在stackoverflow上搜索了很多答案,但没有得到错误. 解决方法
csrf模块在最新版本中从django.core.context_processors移动到django.views.decorators.你可以参考
here
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |