Unicodedecodeerror with runserver

后端 未结 3 923
醉酒成梦
醉酒成梦 2020-11-28 15:07

After setting up all what django requires, I tried the runserver command and I caught an error:

UnicodeDecodeError

3条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 15:21

    I hit this issue on python 3.4 with the following situation :

    • Server did have an ascii-only hostname (like host1)
    • The /etc/hosts file did not contain an entry for my hostname
    • There was no available DNS resolver (offline computer)

    After adding the following entry to the /etc/hosts file, no further UnicodeDecodeError exceptions were thrown.

    127.0.0.1 localhost host1
    

提交回复
热议问题