-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.py
36 lines (29 loc) · 1.06 KB
/
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
32
33
34
35
36
# coding: utf-8
import os
class Config(object):
SECRET_KEY = os.getenv('SECRET')
MAIL_SERVER = os.getenv('MAIL_SERVER')
MAIL_PORT = os.getenv("MAIL_PORT")
MAIL_USE_TLS = os.getenv("MAIL_USE_TLS")
MAIL_USERNAME = os.getenv("MAIL_USERNAME")
MAIL_PASSWD = os.getenv("MAIL_PASSWD")
SQLALCHEMY_TRACK_MODIFICATIONS = False
def init_app(self):
pass
class DevConfig(Config):
DEBUG = True
ADMIN = os.getenv("DEV_ADMIN")
SQLALCHEMY_DATABASE_URI = os.getenv("DEV_SQLALCHEMY_DATABASE_URI") or "mysql+pymysql://root:qwe123@127.0.0.1/flasky"
class TestingConfig(Config):
Testing = True
ADMIN = os.getenv("TEST_ADMIN")
SQLALCHEMY_DATABASE_URI = os.getenv("TEST_SQLALCHEMY_DATABASE_URI") or "mysql+pymysql://root:qwe123@127.0.0.1/flasky"
class ProdConfig(Config):
ADMIN = os.getenv("ADMIN")
SQLALCHEMY_DATABASE_URI = os.getenv("SQLALCHEMY_DATABASE_URI") or "mysql+pymysql://root:qwe123@127.0.0.1/flasky"
config = {
"dev":DevConfig,
"test":TestingConfig,
"prod":ProdConfig,
"default":DevConfig
}