2

I'm trying to build a Django project with Python 3.4.1. manage.py runserver raises a UnicodeDecodeException.

How can this be resolved? See the below (trimmed) traceback:

Traceback (most recent call last):
  File "C:\Python34\lib\socketserver.py", line 429, in __init__
    self.server_bind()
  File "C:\Python34\lib\site-packages\django\core\servers\basehttp.py", line 121
, in server_bind
    super(WSGIServer, self).server_bind()
  File "C:\Python34\lib\wsgiref\simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "C:\Python34\lib\http\server.py", line 135, in server_bind
    self.server_name = socket.getfqdn(host)
  File "C:\Python34\lib\socket.py", line 460, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 12: invalid
 continuation byte

Per request, my hostname:

C:\Users\AnatoliyVik>hostname
AnatoliyVik-ПК
Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
AnatoliyVik
  • 41
  • 1
  • 4
  • 1
    Will you please check your hostname? type `hostname` on console and add it to question. – Nilesh Sep 20 '14 at 12:21
  • Did you try using Python 2.7 instead ? – RobertoAllende Sep 20 '14 at 12:55
  • I don't think JetBrains/PyCharm is compatible with Django 1.7 - several commands are missing like migrate, makemigrations. Try generating the project via the command line and import it later into PyCharm – Luis Masuelli Sep 22 '14 at 16:41
  • 1
    Answers shouldn't be edited into the question -- they should be added **as answers**, and voted on / accepted. Similarly, if updating the question to respond to comments, make sure that the question remains readable on its own, without needing to read comments before it can be understood. If you want a shorter response to a comment, just add that as a comment itself. – Charles Duffy Sep 22 '14 at 17:04

1 Answers1

2

Changing the hostname to no longer include Cyrillic symbols resolves the problem.

Thanks to @Lafada for the guidance.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
AnatoliyVik
  • 41
  • 1
  • 4