很抱歉问一个noob问题,但我不知道为什么会这样。
我刚刚重新安装了Django 1.3,并且我第一次尝试使用PyCharm。当我从终端运行python manage.py runserver
时,一切都顺利进行,但是如果我在PyCharm中尝试runserver
,我会得到以下结果:
Importing Django settings module settings
Traceback (most recent call last):
Validating models...
0 errors found
Django version 1.3, using settings 'glist.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
File "/Applications/PyCharm 1.2.1.app/helpers/pycharm/django_manage.py", line 19, in <module>
run_module(manage_file, None, '__main__')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 180, in run_module
fname, loader, pkg_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/goon/code/glist/manage.py", line 14, in <module>
execute_manager(settings)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 67, in handle
self.run(*args, **options)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 76, in run
autoreload.main(self.inner_run, args, options)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 131, in main
reloader(main_func, args, kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 104, in python_reloader
reloader_thread()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 83, in reloader_thread
ensure_echo_on()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 77, in ensure_echo_on
attr_list = termios.tcgetattr(fd)
termios.error: (25, 'Inappropriate ioctl for device')
Process finished with exit code 1
请注意,在我从浏览器中请求任何页面之前,这一切都在发生。而且,正如我所说,我从终端运行没有问题。任何帮助将不胜感激。
答案 0 :(得分:11)
你使用的pycharm版本是什么?实际上它在django 1.3中是一个错误。如果您尝试在重新加载模式下从任何ide运行django,将会发生这种情况。它可以通过修补django来修复。虽然PyCharm应该自动切换到无重载模式。
阅读本文:http://blogs.jetbrains.com/pycharm/2011/03/pycharm-1-2-1-release-candidate-py-test-2-0-buildout-1-5/
答案 1 :(得分:0)
应用补丁。它的Django 1.3.1错误。这对我来说是pYCharm 3.4.1