python – 带有runserver的Unicodedecodeerror
发布时间:2020-11-17 08:46:37 所属栏目:Python 来源:互联网
导读:在设置了所有 django所需的内容之后,我尝试了runserver命令并且发现了一个错误: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xcf in position 8: invalid continuation byte 从: c:suepython manage.py runserverValidating models.
在设置了所有 django所需的内容之后,我尝试了runserver命令并且发现了一个错误:
从: c:sue>python manage.py runserver Validating models... 0 errors found April 16,2014 - 15:02:42 Django version 1.6.2,using settings 'sue.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000000003890048> Traceback (most recent call last): File "C:python34libsite-packagesdjangoutilsautoreload.py",line 93,in wrapper fn(*args,**kwargs) File "C:python34libsite-packagesdjangocoremanagementcommandsrunserver.py",line 127,in inner_run ipv6=self.use_ipv6,threading=threading) File "C:python34libsite-packagesdjangocoreserversbasehttp.py",line 167,in run httpd = httpd_cls(server_address,WSGIRequestHandler,ipv6=ipv6) File "C:python34libsite-packagesdjangocoreserversbasehttp.py",line 109,in __init__ super(WSGIServer,self).__init__(*args,**kwargs) File "C:python34libsocketserver.py",line 430,in __init__ self.server_bind() File "C:python34libsite-packagesdjangocoreserversbasehttp.py",line 113,in server_bind super(WSGIServer,self).server_bind() File "C:python34libwsgirefsimple_server.py",line 50,in server_bind HTTPServer.server_bind(self) File "C:python34libhttpserver.py",line 137,in server_bind self.server_name = socket.getfqdn(host) File "C:python34libsocket.py",line 460,in getfqdn hostname,aliases,ipaddrs = gethostbyaddr(name) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 8: invalid continuation byte 我使用的是Windows 7 x64,python 3.4和django 1.6.2.这个错误是什么意思? 解决方法这听起来像 this Python issue.如果您的计算机名称具有非ASCII字符,则此操作将失败.你可以:>使用显式主机和端口发出runserver命令:python manage.py runserver 127.0.0.1:8000>将计算机名称更改为仅包含ASCII字符的字符串. (编辑:4S站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- python – Pyro4:找不到名称服务器
- python-2.7 – Pandas:基于空行拆分数据框
- python – Django:有没有办法在与包含ManyToManyField的模
- django – 组织硒测试和单元测试的最佳实践
- 为什么python设计为str(无)返回’None’而不是空字符串?
- 如何使用基于numpy的日期的窗口获取时间序列的回溯移动平均
- django foreignkey包含查询
- django芹菜 – 如何发送request.FILES [‘photo’]到任务
- python – TensorFlow:Hadamard产品::我如何得到这个?
- python – 如何将列表或字符串解析为固定长度的块