1

I wanted to start learning Django framework, but I have already run into a problem. I had set up Django and everything but when I got to the point to run server my problems have started. After I write python manage.py runserver:

C:\Users\Programiranje\Desktop\Django\mysite> python manage.py runserver

It throws an exception like this:

Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they are applied.  
Run 'python manage.py migrate' to apply them. May 08, 2016 - 17:47:21 Django version 1.9.6, using settings 'mysite.settings'                        
Starting development server at http://127.0.0.1:8000/ 
Quit the server with CTRL-BREAK. 

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x00000000044E3488>
Traceback (most recent call last):   
File "C:\Python34\lib\site-packages\django-1.9.6py3.4.egg\django\utils\autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)   File "C:\Python34\lib\site-packages\django-1.9.6-py3.4.egg\django\core\management\commands\runserver.py", line 137, in  inner_run
    ipv6=self.use_ipv6, threading=threading)   File "C:\Python34\lib\site-packages\django-1.9.6-py3.4.egg\django\core\servers\basehttp.py", line 188, in run
    httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)   File "C:\Python34\lib\site-packages\django-1.9.6-py3.4.egg\django\core\servers\basehttp.py", line 73, in __init__
    super(WSGIServer, self).__init__(*args, **kwargs)   File "C:\Python34\lib\socketserver.py", line 430, in __init__
    self.server_bind()   File "C:\Python34\lib\site-packages\django-1.9.6-py3.4.egg\django\core\servers\basehttp.py", line 77, 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 463, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte

I would really appreciate any help!

27
  • Have you tried doing what the error is telling you to do? Run 'python manage.py migrate'? Commented May 8, 2016 at 16:02
  • Yes I have. But it still haven't worked, because migation is not connected to bottom error. Commented May 8, 2016 at 16:22
  • What version of python and django did you install? Commented May 8, 2016 at 16:31
  • 1
    I do some searching they actually said the problem occurs because of computer name is include non ascii characters such as ru.stackoverflow.com/questions/485310/… %80/485615#485615 Commented May 8, 2016 at 17:20
  • 1
    Thank you guys - renaming my computer did work for me :D Commented May 8, 2016 at 19:09

4 Answers 4

2

SOLUTION: Make sure, that you computer's name is from characters from ASCII table :)

Sign up to request clarification or add additional context in comments.

Comments

1

I had a similar but far less helpful error message:

System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x00000000051F2518>

(zero traceback provided)

This was caused by a merge migration being present in one of my apps migration folders that referenced migrations that did not exist. The migration referenced other migrations from another VCS branch and had been accidentally committed by a co-worker and I had merged it into my branch.

Posting as an answer here because this is the most visible question regarding this topic.

Comments

1

I faced similar issue and it was because I was using an older version of django. If you are using mac run below commands:

1.Removes current django version and installs latest stable release.

pip3 install -U django 

2.Applies migrations if any. Make sure to run this command in your project directory.

python3 manage.py migrate

3.Starts the server on local port 8000.

python3 manage.py runserver

Cheers!!

Comments

-3

As the error suggests, you have not applied migrations. Just simply run python manage.py migrate. This would be enough.

4 Comments

Not yet because in tutorial series they said that we would do this later :) What does this even mean btw.? Thanks :)
It actually creates the migrations for you, ie: it takes your models.py code and converts it to some pseudo sql so, that when you run migrate command it will create all those tables for you.
Oh, thank you :) I found this Django actually very interisting :)
Yea, it's really good. Have fun with it :) . And yes, do try the makemigrations command first.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.