How to start django development server on startup?

I added the following command to Session -> Startup, but it didn't work. I am 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 unavailable for binding during the execution phase of this command?

What I am doing now is add another cronjob to restart the development server if it doesn't work every 5 minutes? Is this the best way to run it on startup?

+2


source to share


3 answers


Hopefully you are not trying to start the server in a production environment (as per the django docs ). Look at apache with mod_wsgi instead .

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



See this server answer for details .

+4


source


Mmmm ... isn't it?



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

+3


source


If you want the dev server to always run, you are probably better off setting up a real server on your local machine. It doesn't have to be thick or big. I am using cherokee server. Other options are lighttpd

+1


source







All Articles