Deploying Django app to Heroku

Disclaimer - this isn’t necessary the best way, but it is the way that I deployed my Django app on Heroku.

Firstly, the app was built using the two scoops cookiecutter template. This won’t be described here - I simply describe the process of deployment.

Heroku provides a detailed tutorial for command line deployment. I am using Amazon S3 and Mailgun for serving media and emailing respectively. To use these services with Heroku some environment variables need setting and I found this a bit tedious through the command line. Heroku provides a web interface (https://heroku.com/deploy) for deployment where these environment variables can easily be set. To do this your project needs to have an app.json file to specify config variables. Include a template in your project README to include a deploy button. So, the process went as follows:

  • Go to Github and push the Heroku deploy button on the project README.
  • Add app name, define config vars and deploy the app.
  • Install the Heroku toolbelt.
  • Use the toolbelt to set a git remote –>
$ heroku git:remote -a your-app-name
$ Git remote heroku added.
  • This will enable you to easily deploy any changes to Heroku using git –>
  $ git push heroku master
  • And don’t forget to migrate the database –>
  $ heroku run python manage.py migrate

Dan Matthews

Dan Matthews
NIC@King's manager and hobbyist programmer

Installing a Canon LBP7010C printer in Ubuntu 16.04

how to connect and install a canon LBP7010C printer in Ubuntu 16.04 Continue reading

Postgres user

Published on May 16, 2016