Week 8, Day 4

Code from class:

Homework:

Steps to deploy on Heroku:

  1. pip install django-toolbelt
  2. pip freeze > requirements.txt
  3. heroku create {subdomain} in your project.
  4. Set the proper environment variables on Heroku:
    • heroku config:set DJANGO_SETTINGS_MODULE={your_project}.heroku_settings
    • heroku config:set PYTHONPATH={your_project}
    • heroku config:set SECRET_KEY={some key, at least 40 characters}
  5. Add a file called heroku_settings.py next to your settings.py. Example
  6. Update your wsgi.py.
  7. Add a Procfile. Example
  8. Add a runtime.txt. Example
  9. git commit -am 'Added files for Heroku'
  10. git push heroku master
  11. If all this works:
    • heroku run python {your_project}/manage.py migrate

This article from Heroku is much more detailed.