Q
Q
Qvint012020-02-07 17:27:11
Django
Qvint01, 2020-02-07 17:27:11

Why is django not working?

Hello, when I run django, I get the following (and the site doesn't load):

spoiler

07, 2020 - 17:21:32
Django version 3.0.3, using settings 'myfirst.settings'
Starting development server at 127.0.0.1:8000
Quit the server with CTRL-BREAK.
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\thread
ing.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\thread
ing.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-p
ackages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-p
ackages\django\core\management\commands\runserver.py", line 138, in inner_r
un
run(self.addr, int(self.port), handler,
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-p
ackages\django\core\servers\basehttp.py", line 206, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\site-p
ackages\django\core\servers\basehttp.py", line 67, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\socket
server.py", line 452, in __init__
self.server_bind()
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\wsgire
f\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\http\s
erver.py", line 139, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\admin\AppData\Local\Programs\Python\Python38-32\lib\socket
.py", line 756, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 6: inv
alid continuation byte


What could be the error and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-02-07
@Qvint01

The problem is that your computer name contains Cyrillic characters.

Hostnames are composed of a series of labels concatenated with dots, as are all domain names. For example, "en.wikipedia.org" is a hostname. Each label must be between 1 and 63 characters long, and the entire hostname (including the delimiting dots but not a trailing dot) has a maximum of 253 ASCII characters.
The Internet standards for protocols mandate that component hostname labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the hyphen ('-') . The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits.No other symbols, punctuation characters, or white space are permitted .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question