django runserver出错 - OverflowError:getsockaddrarg:port必须为0-65535

时间:2014-03-21 00:19:28

标签: django sockets port

我回到我以前工作的django项目,在runserver命令后找到以下错误:

0 errors found
March 20, 2014 - 23:58:52
Django version 1.6.2, using settings 'roja.settings'
Starting development server at http://0.0.0.0:80000/
Quit the server with CONTROL-C.
Unhandled exception in thread started by <function wrapper at 0x21cc398>
Traceback (most recent call last):
  File "/home/vagrant/pay-venv/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 93, in wrapper
    fn(*args, **kwargs)
  File "/home/vagrant/pay-venv/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 127, in inner_run
    ipv6=self.use_ipv6, threading=threading)
  File "/home/vagrant/pay-venv/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 167, in run
    httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
  File "/home/vagrant/pay-venv/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 109, in __init__
    super(WSGIServer, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/SocketServer.py", line 408, in __init__
    self.server_bind()
  File "/home/vagrant/pay-venv/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 113, in server_bind
    super(WSGIServer, self).server_bind()
  File "/usr/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind
    HTTPServer.server_bind(self)
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "/usr/lib/python2.7/SocketServer.py", line 419, in server_bind
    self.socket.bind(self.server_address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
OverflowError: getsockaddrarg: port must be 0-65535.

谁知道发生了什么?谢谢大家。

1 个答案:

答案 0 :(得分:5)

看起来你正试图在端口8万(80000)上运行你的应用程序,因为我们只有65000 (65535)端口。删除一个零,你应该好好去!