mirror of
https://github.com/Fluffy-Bean/GameExpo23.git
synced 2025-05-21 10:34:52 +00:00
Switch to Postgres database
This commit is contained in:
parent
fda3fcc28c
commit
5248ae0123
6 changed files with 67 additions and 19 deletions
|
@ -1,10 +1,21 @@
|
|||
import os
|
||||
|
||||
SECRET_KEY = os.getenv('SECRET_KEY')
|
||||
BEARER_TOKEN = os.getenv('BEARER_TOKEN')
|
||||
# Purely to make the code a bit more readable
|
||||
def env(key):
|
||||
return os.getenv(key)
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///db.sqlite'
|
||||
SECRET_KEY = env('SECRET_KEY')
|
||||
BEARER_TOKEN = env('BEARER_TOKEN')
|
||||
|
||||
user = env('DB_USER')
|
||||
password = env('DB_PASSWORD')
|
||||
host = env('DB_HOST')
|
||||
port = env('DB_PORT')
|
||||
database = env('DB_NAME')
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{user}:{password}@{host}:{port}/{database}"
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
SQLALCHEMY_POOL_RECYCLE = 621
|
||||
|
||||
MIGRATION_DIR = '/data/storage/migrations'
|
||||
INSTANCE_DIR = '/data/storage/instance'
|
Loading…
Add table
Add a link
Reference in a new issue