Python 无法理解的Django Runserver错误
我在Django遇到了很多问题(并不是所有问题都解决了),但这是迄今为止最奇怪、最令人费解的问题。当我加载页面时会发生这种情况: >python manage.py runserver Validating models... 0 errors found Django version 1.3.1, using settings 'ponysite.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. [01/Nov/2011 01:21:49] "GET / HTTP/1.0" 500 102747 Traceback (most recent call last): File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 284, in run self.finish_response() File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 324, in finish_response self.write(data) File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 420, in write self._write(data) File "C:\Python27\lib\socket.py", line 324, in write self.flush() File "C:\Python27\lib\socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 10054] An existing connection was forcibly closed by the remote host ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 63095) Traceback (most recent call last): File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock self.process_request(request, client_address) File "C:\Python27\lib\SocketServer.py", line 310, in process_request self.finish_request(request, client_address) File "C:\Python27\lib\SocketServer.py", line 323, in finish_request self.RequestHandlerClass(request, client_address, self) File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 570, in __init__ BaseHTTPRequestHandler.__init__(self, *args, **kwargs) File "C:\Python27\lib\SocketServer.py", line 641, in __init__ self.finish() File "C:\Python27\lib\SocketServer.py", line 694, in finish self.wfile.flush() File "C:\Python27\lib\socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 10054] An existing connection was forcibly closed by the remote host ---------------------------------------- Traceback (most recent call last): File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 284, in run self.finish_response() File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 324, in finish_response self.write(data) File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 420, in write self._write(data) File "C:\Python27\lib\socket.py", line 324, in write self.flush() File "C:\Python27\lib\socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 10054] An existing connection was forcibly closed by the remote host ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 63099) Traceback (most recent call last): File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock self.process_request(request, client_address) File "C:\Python27\lib\SocketServer.py", line 310, in process_request self.finish_request(request, client_address) File "C:\Python27\lib\SocketServer.py", line 323, in finish_request self.RequestHandlerClass(request, client_address, self) File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 570, in __init__ BaseHTTPRequestHandler.__init__(self, *args, **kwargs) File "C:\Python27\lib\SocketServer.py", line 641, in __init__ self.finish() File "C:\Python27\lib\SocketServer.py", line 694, in finish self.wfile.flush() File "C:\Python27\lib\socket.py", line 303, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 10054] An existing connection was forcibly closed by the remote host ---------------------------------------- [01/Nov/2011 01:21:53] "GET / HTTP/1.0" 500 102391Python 无法理解的Django Runserver错误,python,django,Python,Django,我在Django遇到了很多问题(并不是所有问题都解决了),但这是迄今为止最奇怪、最令人费解的问题。当我加载页面时会发生这种情况: >python manage.py runserver Validating models... 0 errors found Django version 1.3.1, using settings 'ponysite.settings' Development server is running at http://127.0.0.1:8000/ Quit t
Ban
是models.py
(在views.py
中导入)中的一个模型,我玩了一段时间,但它现在在我的模型、视图和控制器中到处都被注释掉了。我不知道这是否与问题有关
各位,请提前感谢。基于这句话:
File "C:\Users\kiwi\Dropbox\Programming Projects\Django Projects\ponysite\forum\admin.py" in
1. from forum.models import Category, Thread, Post, Report, Subscription, Ban
Django在forum/admin.py中找到
from forum.models import Category, Thread, Post, Report, Subscription, Ban
请注意末尾未在模型中定义的
Ban
。删除它,错误就会消失。这说明您没有在forum/models.py中定义类禁令。你能再检查一遍吗?真不敢相信这件事被人发现了。非常感谢,迪吉甘皮尔。
from forum.models import Category, Thread, Post, Report, Subscription, Ban