Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.