So here’s my problem. I have a ton of data, and I need it to be dynamically available to run apps on my dashboard. Sound familiar? More specifically, I run the Philosophy Data Project, which is a website that implements data-driven tools to help people explore the history of philosophy. So I have something like 330,000 sentences of philosophy and I add to it all the time, and I need all that to be dynamically available for people to search easily via the apps on my site.
I can’t just dump a giant spreadsheet into Heroku; that would break the slug size and would be incredibly slow. Luckily, Heroku is very helpful and they will provide you with a free Heroku Postgres server to house your data and have it accessible.
Great, but it turned out that actually setting this up wasn’t as simple as all that, and while there were definitely some people with great tutorials online, none of them really took us from start to finish. So that’s what I’ll do here.
There are three main steps:

  1. Set up Heroku Postgres and connect it to your app.
  2. Add data to your server.
  3. Call the data and run queries in your app.
    Let’s go through them one at a time. To start, all you’ll need is an existing Heroku app.

#heroku #sql #tutorial #python #dash #django

Set Up Heroku PostgreSQL for Your App in Python
1.50 GEEK