Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 1.96 KB

File metadata and controls

39 lines (22 loc) · 1.96 KB

PostgreSQL_Heroku_Tutorial

Create and connect to a Heroku PostgreSQL server by using Python in a Jupyter Notebook!

Authors: Daniel Kim & Dae Han

To examine a real-life project application of this notebook, click here on Dae's capstone. He built a time series model to forecast the total number of individuals sheltered by the NYC Department of Homeless Services (DHS).

Click here to download the Jupyter Notebook that explains how to create a Heroku account, add a PostgreSQL server, and upload a sample Pandas dataFrame to the server. The following instructions down below are found in the linked notebook above!

First, go to heroku and sign up for a free account - https://www.heroku.com/postgres

Click "Create new app" app

Choose a descriptive and unique App name then click "create app" app_name

Click on this heroku add on link and click "Install Heroku Postgres" install

Link the postgres add on to the app you just named. postgres add_prov

Click on "Heroku Postgres" and go to the settings and click on the database credentials. creds

Note: Credentials are not permanent! There are other ways to obtain credentials, but this is just a simple example

Store the URI in a json file named creds.json. The format in creds.json should be the following: {"uri" : "your-uri-credentials"}. Take notice of the double quotations!

DO NOT UPLOAD YOUR JSON FILE ONTO GITHUB! INCLUDE THE creds.json FILE IN THE GITIGNORE TEXT