python – ImportError:没有名为context_processors的模块

python – ImportError:没有名为context_processors的模块,第1张

概述我在我的 django项目中运行命令: – $python manage.py runserver 然后我得到的错误如下: – from django.core.context_processors import csrfImportError: No module named context_processors 这是结果 $pip freezedj-database-url==0.4.1 我在我的 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.0.6Django==1.10django-toolbelt==0.0.1gunicorn==19.6.0pkg-resources==0.0.0psycopg2==2.6.2static3==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 总结

以上是内存溢出为你收集整理的python – ImportError:没有名为context_processors的模块全部内容,希望文章能够帮你解决python – ImportError:没有名为context_processors的模块所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1194998.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-03
下一篇2022-06-03

发表评论

登录后才能评论

评论列表(0条)

    保存