Member-only story

Deploying Django to Heroku: Procfile, STATIC_ROOT, & Other Pitfalls

Bennett Garner
10 min readJan 24, 2019

--

Heroku’s help wasn’t helpful enough, so I wrote this guide to get you (and me) though your first deployment.

Update 2/11/20: It’s been a while since I wrote this post, and there’s now a better way: https://devcenter.heroku.com/articles/heroku-postgresql#connecting-with-django

That said, this post might still be useful to some of you who are new to Heroku!

Heroku is a great option for deploying your apps. It’s especially attractive if you want to use a relational database, because PostgreSQL is free on Heroku if you’re a hobby developer. On other cloud providers like Google Cloud or AWS, you have to pay for your databases.

That said, it took me a little while to get my barebones Django application running on Heroku. It was especially difficult because Heroku’s docs aren’t comprehensive. I had to stitch this workflow together with help from Stack Overflow.

Here’s what you need to do to go from zero to deployed on Heroku with a Django application from the command line.

Are you an experienced dev just looking for some source code? I’m happy to oblige: https://github.com/bennett39/django-heroku-example/tree/barebones

Prereqs

--

--

Bennett Garner
Bennett Garner

Written by Bennett Garner

DeveloperPurpose.com — Build a coding career with meaning and purpose 💻 Top writer in technology ✍️

Responses (10)