Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run "python manage.py runserver" from a bash script

I want to run "python manage.py runserver" from a bash script

First if I wanted to run from a terminal "python manage.py runserver &" but it doesn't work. I found the fix for this in (https://code.djangoproject.com/changeset/16327). Manually in a terminal running "python manage.py runserver &" works fine. I've added in a bash script "python manage.py runserver &" but it doesn't start the server.

Error:
File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/utils/autoreload.py", line 137, in main
    reloader(main_func, args, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/utils/autoreload.py", line 110, in python_reloader
    reloader_thread()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/utils/autoreload.py", line 89, in reloader_thread
    ensure_echo_on()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.3-py2.7.egg/django/utils/autoreload.py", line 77, in ensure_echo_on
    attr_list = termios.tcgetattr(fd)
termios.error: (25, 'Inappropriate ioctl for device')
like image 880
Sorin M Avatar asked Jun 16 '11 08:06

Sorin M


1 Answers

The problem is probably that hudson is not running as your user... you could run

source /home/your_user/.bashrc && django_serve 

to make it run that alias, but I think you'll probably need to switch users

-- or --

have hudson run the dev server from it's own checkout of the source

Edit: Looking at your erro though, I think this may solve your problem:

instead of

python manage.py runserver

try adding the --noreload flag to disable the auto reloader

python manage.py runserver --noreload
like image 72
Jiaaro Avatar answered Oct 15 '22 17:10

Jiaaro