-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
24 lines (20 loc) · 747 Bytes
/
config.py
File metadata and controls
24 lines (20 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
SECRET_KEY = os.urandom(32)
# Grabs the folder where the script runs.
basedir = os.path.abspath(os.path.dirname(__file__))
#Some configuration in .flaskenv and .env files
# Connect to the database
#Get the value of the environment variables
user = 'DB_USR'
password = 'DB_PASSWD'
host = 'DB_HOST'
database_uri = 'DB_URL'
DATABASE_URI = os.getenv(database_uri)
print(DATABASE_URI)
# IMPLEMENT DATABASE URI
SQLALCHEMY_DATABASE_URI = os.getenv(database_uri, 'postgresql://postgres@localhost:5432/postgres')
#Removes the significant overhead in starting the application
SQLALCHEMY_TRACK_MODIFICATIONS = False
#Allows me see the SQL queries being printed on the terminal
SQLALCHEMY_ECH0 = True
#Ensure it is created in development folder