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.
+4
source to share