gpt4 book ai didi

python - django 从 1.9 升级到 1.10 __init__() 得到意外的关键字参数 'current_app'

转载 作者:太空宇宙 更新时间:2023-11-03 15:45:02 26 4
gpt4 key购买 nike

我刚刚将 Django 从 1.9 升级到 1.10。我在测试环境中运行 1.10 并解决了所有升级问题以确保一切正常。

但是,当我在我的实时网站上执行此操作并加载主页时,我收到以下错误

环境:

Request Method: GET
Request URL: http://it.local.com/

Django Version: 1.10.5
Python Version: 2.7.5
Installed Applications:
('home.apps.HomeConfig',
'oncall.apps.OncallConfig',
'tools.apps.ToolsConfig',
'sites.apps.SitesConfig',
'maintenance.apps.MaintenanceConfig',
'service.apps.ServiceConfig',
'management.apps.ManagementConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'bootstrap_pagination',
'easy_thumbnails')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')



Traceback:

File "/usr/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
39. response = get_response(request)

File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)

File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)

File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/var/www/infternal/home/views.py" in index
13. return render(request, 'home/index.html', {"user": user})

File "/usr/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render
49. context_instance = RequestContext(request, current_app=current_app)

Exception Type: TypeError at /
Exception Value: __init__() got an unexpected keyword argument 'current_app'

最佳答案

您似乎没有正确安装 Django 1.10。回溯 context_instance = RequestContext(request, current_app=current_app) 中的行在 Django 1.10 中不存在。我会尝试卸载并重新安装 Django,然后重新启动服务器。

关于python - django 从 1.9 升级到 1.10 __init__() 得到意外的关键字参数 'current_app',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41828627/

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