Deploying Django app on linux server running uwsgi from Github

  1.  Decide folder for environment.  e.g. /media/www/captainslog.
  2.  Go to media/www and download from github into new directory e.g. sudo git clone https://github.com/mjnaylor8/django-captainslog.git captainslog
  3. Create virtual environment.  sudo python3 venv env
  4. Check it works OK.  Go to env directory and run source bin/activate
  5. Move back up one directory and assuming there is a requirements.txt file run pip3 install -r requirements.txt
  6. Deploy any bespoke apps from github…..  pip install git+https://github.com/mjnaylor8/django-mapbox-location-field.git
  7. Make changes to manage.py, asgi.py and wsgi.py to ensure pointing to production settings ….
    os.environ.setdefault(‘DJANGO_SETTINGS_MODULE’, ‘captains_log.settings.production‘)
  8. Run python3 manage.py collectstatic to ensure all collected OK
  9. Restart emporer sudo systemctl restart emperor.uwsgi
  10. Restart nginx sudo systemctl restart nginx
  11. Pray it is OK