tags:

views:

185

answers:

4

I added following command to Sessions -> Startup program but it didn't work. I'm using Ubuntu.

sudo -u www-data python manage.py 192.168.1.2:8001

192.168.1.2 is the ip address on ath0. Is it still not available for binding at the stage when this command is executed?

What I currently do is add another cronjob to restart the development server if it's not running every 5 minutes? Is it a better way to run it at startup?

+3  A: 

Hopefully you're not trying to run the server in a production environment (according to the django docs). Take a look instead at apache with mod_wsgi.

If you are just running for local development, there is no need to run as the www-data user. You might want to look into the @reboot directive for cron, and just run the server as your user.

See this answer for details on runserver.

John Paulett
Yes, it's for local development only. I just dont want to start the development server on every reboot.
jack
Another thing you could do (although not the best solution), is to put the start command (likely changing directory first) in your ~/.bashrc file, so it is run whenever you log in.
John Paulett
You can still use mod_wsgi for local development. See 'http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html'.
Graham Dumpleton
+1  A: 

If you want the dev server to always run, you're probably better off setting up a real server on your local machine. It doesn't have to be something fat or big. I use cherokee server. Another options is lighttpd

hasen j
A: 

just deploy it at your dev server. good reference here

A: 

Mmmm... shouldn't it be?

sudo -u www-data python manage.py runserver 192.168.1.2:8001

jdelacueva