0

I tried today to install Django for Python 3.4. I managed to create a project but when I try to run the server with python manage.py runserver (I'm on Windows 7), I get an error :

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.
December 29, 2014 - 14:51:44
Django version 1.7.1, using settings 'sdz.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>.wrappe
 at 0x00000000043D3268>
Traceback (most recent call last):
 File "C:\Python34\lib\site-packages\django\utils\autoreload.py", line 222, in
wrapper
 fn(*args, **kwargs)
 File "C:\Python34\lib\site-packages\django\core\management\commands\runserver
py", line 134, in inner_run
 ipv6=self.use_ipv6, threading=threading)
 File "C:\Python34\lib\site-packages\django\core\servers\basehttp.py", line 16
, in run
 httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
 File "C:\Python34\lib\site-packages\django\core\servers\basehttp.py", line 11
, 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\core\servers\basehttp.py", line 12
, 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 137, 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 0xe9 in position 3: invalid
continuation byte

And I can't access my server. How can I run the server ? Thanks,

Daniel Roseman
602k68 gold badges910 silver badges923 bronze badges
asked Dec 29, 2014 at 14:48
4
  • Hi, did you modify your database or models.py after creating the project? If so try to remove your database and let django create it from scratch. Commented Dec 29, 2014 at 15:13
  • The first message says that you have unapplied migrations. Do that first Commented Dec 29, 2014 at 15:14
  • On the other hand this pretty much looks like an encoding problem on your settings file, sdz.settings. I think you copied from a tutorial or somewhere, check every field like "hostname" and try to rewrite it. Commented Dec 29, 2014 at 15:27
  • I didn't modify anything, and I tried removing the DB. Still not working. I did the migrations, but nothing. I didn't copied it, I just did django-admin.py startproject sdz. Commented Dec 29, 2014 at 17:15

2 Answers 2

1

Run the following command:

manage.py migrate

This will create your tables in your database, then try running your server.

answered Dec 29, 2014 at 20:53
Sign up to request clarification or add additional context in comments.

Comments

0

Okay I got it, it was pretty dumb, I just had non-ASCII characters in my hostname. Now it works perfectly !

answered Dec 30, 2014 at 8:06

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.