簡體   English   中英

運行Django服務器(Python 3.4)

[英]Running Django server (Python 3.4)

我今天嘗試安裝適用於Python 3.4的Django。 我設法創建了一個項目,但是當我嘗試使用python manage.py runserver (在Windows 7上)運行服務器時,出現錯誤消息:

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

而且我無法訪問我的服務器。 如何運行服務器? 謝謝,

運行以下命令:

manage.py migrate

這將在數​​據庫中創建表,然后嘗試運行服務器。

好的,我明白了,它很傻,我的主機名中只有非ASCII字符。 現在,它可以完美運行了!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM