-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
31 lines (22 loc) · 985 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
29
30
31
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY', 'supersecret')
SQLALCHEMY_TRACK_MODIFICATIONS = os.environ.get(
'SQLALCHEMY_TRACK_MODIFICATIIONS', False)
PER_PAGE = int(os.environ.get('PER_PAGE')) or 50
MAIL_SERVER = os.environ.get('MAIL_SERVER')
MAIL_PORT = os.environ.get('MAIL_PORT')
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS')
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
MAIL_SENDER = os.environ.get('MAIL_SENDER')
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URI') or \
'sqlite:///' + os.path.join(BASE_DIR, 'dev.db')
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get('PROD_DATABASE_URI')
config = {"development": DevelopmentConfig, "production": ProductionConfig}