Python3 Runserver TypeError {newbie}

时间:2013-11-06 17:12:16

标签: python django

我是Python的新手,但我已经全神贯注地寻找这个问题的答案了。看起来每个人都有所不同。我在osx Mavericks上,使用Python 3.4和Django 1.7。

当我运行python3 manage.py runserver时,我没有得到任何服务器详细信息,我得到了

TypeError: 'NoneType' object is not callable

这是我的追溯:

Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 416, in execute_from_command_line
Validating models...

utility.execute()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 408, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/base.py", line 244, in run_from_argv
0 errors found
self.execute(*args, **options.__dict__)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/base.py", line 291, in execute
output = self.handle(*args, **options)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 76, in handle
self.run(*args, **options)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 85, in run
autoreload.main(self.inner_run, args, options)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/utils/autoreload.py", line 359, in main
reloader(wrapped_main_func, args, kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/utils/autoreload.py", line 325, in python_reloader
reloader_thread()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/utils/autoreload.py", line 304, in reloader_thread
if fn():
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/utils/autoreload.py", line 173, in kqueue_code_changed
watcher = tempfile.TemporaryFile(bufsize=0)
TypeError: TemporaryFile() got an unexpected keyword argument 'bufsize'
Exception ignored in: <bound method Signal._remove_receiver of  <django.dispatch.dispatcher.Signal object at 0x1022d1588>>
Traceback (most recent call last):
 File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site packages/django/dispatch/dispatcher.py", line 276, in _remove_receiver
 TypeError: 'NoneType' object is not callable

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

如果您是Python和Django的新手,那么请使用最新版本而不是开发版本。在撰写本文时,最新的版本是Django 1.6和Python 2.7或3.3。

我建议现在使用Python 2.7和Django,因为你找到的大多数教程和博客都将用于Python 2.X。