The following error appears when running the runserver with the long-range setting set.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 5: invalid start byte
I know it's an encoding error, but how do I fix it?
The complete error log is below.
Quit the server with CTRL-BREAK.
Unhandled exception in thread started by .wrapper at 0x03BD2C00>
Traceback (most recent call last):
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 142, in inner_run
ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py", line 163, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\servers\basehttp.py", line 66, in init
super().__init__(*args, **kwargs)
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py", line 449, in init
self.server_bind()
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\wsgiref\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\http\server.py", line 139, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\sophist\AppData\Local\Programs\Python\Python37-32\lib\socket.py", line 676, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 5: invalid start byte
django web frameworks encoding error
The link in the comments is broken. Hmm.
Probably because the "computer name" in Windows is Korean. Change the computer name to English, reboot, and try again.
© 2024 OneMinuteCode. All rights reserved.