-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
28 lines (24 loc) · 825 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.dirname(__file__))
load_dotenv(path.join(basedir, '.env'))
class Config:
FLASK_APP=environ.get("FLASK_APP")
SECRET_KEY=environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = environ.get('DEV_DATABASE_URI')
# SESSION_COOKIE_NAME = environ.get('SESSION_COOKIE_NAME')
STATIC_FOLDER='static'
TEMPLATES_FOLDER='templates'
SQLALCHEMY_TRACK_MODIFICATIONS = False
POSTS_PER_PAGE=5
class ProdConfig(Config):
FLASK_DEBUG = 0
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = environ.get('PROD_DATABASE_URI')
class DevConfig(Config):
FLASK_DEBUG = 1
DEBUG = True
TESTING = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = environ.get('DEV_DATABASE_URI')