6

Sorry to ask a noob question but I have no idea why this is happening.

I've just reinstalled Django 1.3, and am trying PyCharm for the first time. When I run python manage.py runserver from Terminal everything goes without a hitch, however if I try to runserver from within PyCharm I get the following:

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

Please note that this is all happening before I request any page from within the browser. And, as I said, I have no trouble running from Terminal. Any help would be greatly appreciated.

David John Smith
  • 1,824
  • 2
  • 18
  • 22
  • 4
    Same here. This is exactly the thing that puts you off of a product in one second. "Oh, I have this great tool and all you have to do is download and run, oh and patch, and fork, and then use makefile and download dependencies and build them, but the version X.Y is broken so get the previous revision, and then go and shave a yak and everything works out of the box". I'm switching back to vim. – Ska Jun 26 '11 at 16:59

2 Answers2

11

What version fo pycharm are you using ? Actually it`s a error in django 1.3. It will occur if you try to run django from any ide in reload mode. It can be fixed by patching django. Although PyCharm should automatically switch to no reload mode.

Read this : http://blogs.jetbrains.com/pycharm/2011/03/pycharm-1-2-1-release-candidate-py-test-2-0-buildout-1-5/

Aldarund
  • 17,312
  • 5
  • 73
  • 104
  • It's PyCharm 1.2.1, so I'm not sure why it's not switching to no-reload. But I have patched Django and now it's all good. Thanks so much! – David John Smith May 24 '11 at 12:32
  • FYI in case people are still having this issue. I just downloaded pycharm 1.5 and its still having problems with django 1.3 so I had to manually apply the patch. – shawnwall Jun 19 '11 at 16:29
0

Apply the patch. Its Django 1.3.1 error. This worked for me on pYCharm 3.4.1

https://github.com/django/django/commit/3e7ce3c750

Venkat Kotra
  • 10,413
  • 3
  • 49
  • 53