Skip to content

(Step 13) Migrate to PostgreSQL database #22

@thepetk

Description

@thepetk

Issue Details

The project right now is using the default sqlalchemy database and creates an app.db locally. That said, we should create a proper connection with a PostgreSQL database (more info here.

Workaround

  • Install the psycopg2 library -> pip3 install psycopg2 and add it to requirements.txt

  • Inside the app/config.py add (more info about postgres url here):

class Config(object):
...
# DATABASE_URL should be a postgresurl with user and password
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
  • Be sure that you have run all migrations to your db locally.

Metadata

Metadata

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions