Created
November 22, 2015 20:37
-
-
Save seanmavley/d09d7ef4bb1dd8aa873d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clear | |
cd /path/to your/virtual environment #path to your virtual environment | |
. bin/activate #Activate your virtual environment | |
cd /path/to your/project directory #After that go to your project directory | |
python manage.py runserver #run django server | |
After that save this file with .sh extension. I have saved this file as script.sh in the following example. | |
Run following command in terminal for giving execution permission to your script | |
$ chmod u+x script.sh | |
4. To test your script works perfectly, add following command in terminal | |
$ ./ script.sh | |
5. After that, you have to create cron job on your machine for run script automatically on reboot give following command in terminal | |
$ crontab -e | |
Above command will open crontab window, then add the following line in it: | |
@reboot path/to/script.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment