Django开发服务器关机错误

时间:2009-02-24 21:44:19

标签: python django

每当我用CTRL + c关闭我的开发服务器(./manage.py runserver)时,我都会收到以下消息:

[24/Feb/2009 22:05:23] "GET /home/ HTTP/1.1" 200 1571
[24/Feb/2009 22:05:24] "GET /contact HTTP/1.1" 301 0
[24/Feb/2009 22:05:24] "GET /contact/ HTTP/1.1" 200 2377
^C
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/logging/__init__.py", line 1354, in shutdown
    h.flush()
TypeError: flush() takes exactly 2 arguments (1 given)
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/logging/__init__.py", line 1354, in shutdown
    h.flush()
TypeError: flush() takes exactly 2 arguments (1 given)

我最近将项目移动到另一个目录,但其他一切工作正常,所以我不知道这与它有什么关系......

如果我只是启动开发服务器然后立即关闭它,我没有看到错误。只有当我点击浏览器中的某些内容然后关闭服务器...

有人能指出我正确的方向来排除这个问题吗?

提前致谢。

1 个答案:

答案 0 :(得分:2)

您似乎正在使用Mac的默认python安装。我知道这有时被称为奇怪的问题。我建议安装MacPython并将Django安装到该python实例中。