less than 1 minute read

Summary: deploy PostgreSQL on Heroku and ingest Data using Pandas and SQLAlchemy.

Reference: https://towardsdatascience.com/deploy-free-postgresql-database-in-heroku-and-ingest-data-8002c574a57d.

Check this blog on github.

Contents:

1. Introduction

2. Generate and store Heroku token

2.1 Generate Heroku token

2.1.1 Method 1: browser

Go to Account settings → Applications . Under the Authorizations section, click on Create authorizations . You have to give a description in the opened window and set the expiry time or just set no expiry for the token (by leaving the box blank).

2.1.2 Method 2: Heroku CLI

heroku authorizations:create

name

2.1 Store Heroku token to environment

on linux: export HEROKU_API_KEY=<your_token>

on windows: setx HEROKU_API_KEY=<your_token>

  • check it in command window: echo %HEROKU_API_KEY%

  • check it in python:

    import os
    os.environ["HEROKU_API_KEY"]
    

..To be continue

Comments