Skip to content

Instantly share code, notes, and snippets.

@Timtech4u
Created January 4, 2019 12:09
Show Gist options
  • Select an option

  • Save Timtech4u/bd880e0284a0f26b16b59f02a7109f09 to your computer and use it in GitHub Desktop.

Select an option

Save Timtech4u/bd880e0284a0f26b16b59f02a7109f09 to your computer and use it in GitHub Desktop.
Deploying Django

Instructions:

  • Replace with your deployer remote url
  • Change <project_name.wsgi> to your project_name.wsgi
  • Change your runtime.txt value to your python version
# First-time only (update when you have new dependencies)
pip install gunicorn
pip install django-heroku
pip freeze > requirements.txt
# Run this once
git remote add deploy <remote-url>
# Run this whenever you have updates to deploy
git add .
git commit -m "updated codes"
git push deploy master
web: gunicorn <project_name.wsgi>
python-3.6.7
import django_heroku
# All the way at the bottom of the file
# ...
django_heroku.settings(locals())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment