Alice
Alice

Reputation: 11

Django server won't run

I just tries to start django project on win7(x64), but i faced with following issue:

$ python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
March 24, 2018 - 14:24:08
Django version 1.11.3, using settings 'superlists.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 0x035BD978>
Traceback (most recent call last):
  File "C:\Users\alesya\.virtualenvs\superlists\lib\site-packages\django\utils\a
utoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\alesya\.virtualenvs\superlists\lib\site-packages\django\core\ma
nagement\commands\runserver.py", line 149, in inner_run
    ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
  File "C:\Users\alesya\.virtualenvs\superlists\lib\site-packages\django\core\se
rvers\basehttp.py", line 164, in run
    httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
  File "C:\Users\alesya\.virtualenvs\superlists\lib\site-packages\django\core\se
rvers\basehttp.py", line 74, in __init__
    super(WSGIServer, self).__init__(*args, **kwargs)
  File "c:\users\alesya\appdata\local\programs\python\python36-32\Lib\socketserv
er.py", line 453, in __init__
    self.server_bind()
  File "c:\users\alesya\appdata\local\programs\python\python36-32\Lib\wsgiref\si
mple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "c:\users\alesya\appdata\local\programs\python\python36-32\Lib\http\serve
r.py", line 138, in server_bind
    self.server_name = socket.getfqdn(host)
  File "c:\users\alesya\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 0xbb in position 14: invalid
 start byte

My computer has an ASCII name, so I even not realized, what happens. Did all these things on another win7 and everything was ok. Maybe someone can help with?

UPD. My problem was due to the changed 'hosts' file - there are a lot of disabled addresses. Thanks all for the answers.

Upvotes: 1

Views: 1256

Answers (2)

Ro0t
Ro0t

Reputation: 179

try this:

a.encode('utf-8').strip()

if "a" is the string with non-ascii character

Upvotes: 0

Ro0t
Ro0t

Reputation: 179

use python3, if you use python2.x many letters like accents or others, they cause abnormal crashes

Upvotes: 1

Related Questions