简体   繁体   English

Django 1.8应用程序迁移到新服务器时出现奇怪的异常

[英]django 1.8 application migrated to new server rises strange exception

We had this Django 1.8 application working in the server we setup 6 months ago (Fedora 24 64-Bit). 我们已经在6个月前设置的服务器(Fedora 24 64位)中运行了Django 1.8应用程序。 Yesterday we setup a new server with same packages and now we suddenly get this error: 昨天我们用相同的软件包安装了一个新服务器,现在突然出现此错误:

Django Version: 1.8 Exception Type: TypeError Exception Value: Django版本:1.8异常类型:TypeError异常值:

_new_pool() got an unexpected keyword argument 'request_context' _new_pool()获得了意外的关键字参数'request_context'

Exception Location: /usr/lib/python2.7/site-packages/urllib3/poolmanager.py in connection_from_pool_key, line 262 Python Executable: /usr/bin/python Python Version: 2.7.11 异常位置:connection_from_pool_key中的/usr/lib/python2.7/site-packages/urllib3/poolmanager.py,第262行Python可执行文件:/ usr / bin / python Python版本:2.7.11

Seemingly offending code: 看似令人反感的代码:

# Make a fresh ConnectionPool of the desired type
259             scheme = request_context['scheme']
260             host = request_context['host']
261             port = request_context['port']
262             pool = self._new_pool(scheme, host, port,   request_context=request_context)
263             self.pools[pool_key] = pool

May the Django 1.8 files have changed in repository so this doesn't work anymore? Django 1.8文件可能已在存储库中更改,因此不再起作用了吗? seems very strange to me. 对我来说似乎很奇怪。

What version of urrlib3 are you using? 您正在使用哪个版本的urrlib3? Try upgrading it because request_context was added in this commit 9 months ago . 尝试升级它,因为9个月前此提交中添加了request_context。

D. Nibon, you are my hero. D. Nibon,你是我的英雄。 That was the problem. 那就是问题所在。 seems that python-urllib3 package was not installed in this machine. 似乎此机器上未安装python-urllib3软件包。 Solved! 解决了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM