gpt4 book ai didi

python - 类型错误 : __init__() got an unexpected keyword argument 'current_app' Django

转载 作者:太空宇宙 更新时间:2023-11-04 03:03:52 25 4
gpt4 key购买 nike

我刚刚通过 Gitlab 将我的应用程序上传到生产服务器 (Centos7) 并进行了迁移,一切正常,这里的问题是,一旦我想通过浏览器访问,我就会在日志中收到此错误:

File "/usr/lib/python2.7/site-packages/django/shortcuts/__init__.py", line 49, in render
context_instance = RequestContext(request, current_app=current_app)
TypeError: __init__() got an unexpected keyword argument 'current_app'

奇怪的是,我的本地机器上一切正常,我可以毫无问题地运行它,服务器端的唯一区别是我使用生产设置运行服务器(使用生产服务器的配置)

提示:如果我通过 url 运行函数,一切正常运行似乎问题是每次它进入“返回渲染”时我也会收到该消息。

感谢您的关注,

最佳答案

我发现问题是因为我的服务器(1.6 版本)中有一个最旧的 Django 文件夹。我删除了所有 Django 版本,重新启动服务器并安装我的应用程序使用的版本 (1.10.2),问题已解决

关于python - 类型错误 : __init__() got an unexpected keyword argument 'current_app' Django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40135106/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com