我是django的新手,我在virtualenv中启动了一个项目,每当我尝试运行服务器时,我都会收到此消息:
Performing system checks...
System check identified no issues (0 silenced).
March 01, 2018 - 13:22:34
Django version 2.0.2, using settings 'PollApp.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 0x03BBF7C8>
Traceback (most recent call last):
File "C:\Users\Sebastian\Desktop\Desarrollo\HelloWorld1\lib\site-
packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\Sebastian\Desktop\Desarrollo\HelloWorld1\lib\site-
packages\django\core\management\commands\runserver.py", line 143, in
inner_run
ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
File "C:\Users\Sebastian\Desktop\Desarrollo\HelloWorld1\lib\site-
packages\django\core\servers\basehttp.py", line 163, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
File "C:\Users\Sebastian\Desktop\Desarrollo\HelloWorld1\lib\site-
packages\django\core\servers\basehttp.py", line 66, in __init__
super().__init__(*args, **kwargs)
File "c:\users\sebastian\appdata\local\programs\python\python36-
32\Lib\socketserver.py", line 453, in __init__
self.server_bind()
File "c:\users\sebastian\appdata\local\programs\python\python36-
32\Lib\wsgiref\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "c:\users\sebastian\appdata\local\programs\python\python36-
32\Lib\http\server.py", line 138, in server_bind
self.server_name = socket.getfqdn(host)
File "c:\users\sebastian\appdata\local\programs\python\python36-
32\Lib\socket.py", line 673, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 7:
invalid continuation byte
我真的不知道从哪里开始解决这个错误,我安装了WAMP服务器,我应该检查一下是否使用8000端口?
答案 0 :(得分:3)
更改您的计算机名称,使其只有有效的ASCII字符
答案 1 :(得分:2)
根据以下已知问题,您最好的解决方案是更改主机名。 我没有WAMP造成这种情况,除非他们在同一个PORT上运行!
https://code.djangoproject.com/ticket/19357