Django UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 5: invalid continuation byte

Question:

I have not seen such a problem before. I rummaged through Google and did not find an answer. Although other people had similar issues, but their solutions did not suit mine. (Username in English path too)

Problem:
in first Django project manage.py runserver has error:

Performing system checks...

System check identified no issues (0 silenced).

You have 18 unapplied migration(s). Your project may not work properly until you
 apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
August 04, 2022 - 01:06:46
Django version 4.1, using settings 'base.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:pthnlibthreading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:pthnlibthreading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:pthnlibsite-packagesdjangoutilsautoreload.py", line 64, in wrapp
er
    fn(*args, **kwargs)
  File "C:pthnlibsite-packagesdjangocoremanagementcommandsrunserver.py",
 line 158, in inner_run
    run(
  File "C:pthnlibsite-packagesdjangocoreserversbasehttp.py", line 236, in
 run
    httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
  File "C:pthnlibsite-packagesdjangocoreserversbasehttp.py", line 76, in
__init__
    super().__init__(*args, **kwargs)
  File "C:pthnlibsocketserver.py", line 452, in __init__
    self.server_bind()
  File "C:pthnlibwsgirefsimple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "C:pthnlibhttpserver.py", line 140, in server_bind
    self.server_name = socket.getfqdn(host)
  File "C:pthnlibsocket.py", line 756, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 5: invalid
continuation byte


host folder(C:WindowsSystem32driversetc) - 

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
Asked By: Daniel Mielnik

||

Answers:

Try migrations before starting the server.

python manage.py makemigrations
python manage.py migrate
Answered By: ttt

Everything turned out to be far from django, I thought I changed the username to the end, but I had to go all the way to computer > properties > change properties and change full name, thank for you time

Answered By: Daniel Mielnik
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.