From c03eecbf71dc7c1ca2c9e6c064c52e4428fd9cb1 Mon Sep 17 00:00:00 2001 From: hinedy Date: Thu, 20 Oct 2022 20:05:29 +0200 Subject: [PATCH] added Procfile --- Procfile | 1 + app.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..8001d1a --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn app:app \ No newline at end of file diff --git a/app.py b/app.py index c21d4b7..b267803 100644 --- a/app.py +++ b/app.py @@ -22,8 +22,11 @@ app.config["SESSION_TYPE"] = "filesystem" Session(app) -# Configure CS50 Library to use SQLite database -db = SQL("sqlite:///finance.db") +# Configure CS50 Library to use PostgreSQL database +uri = os.getenv("DATABASE_URL") +if uri.startswith("postgres://"): + uri = uri.replace("postgres://", "postgresql://") +db = SQL(uri) # Make sure API key is set if not os.environ.get("API_KEY"):