2024-07-29 11:43:52 +08:00
|
|
|
import os
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
|
2024-08-01 13:28:09 +08:00
|
|
|
class Config: # 公共配置
|
2024-07-29 11:43:52 +08:00
|
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
|
|
|
|
FLASKY_ADMIN = os.environ.get('FLASKY_ADMIN')
|
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
|
|
FLASKY_POSTS_PER_PAGE = 5
|
|
|
|
FLASKY_PATIENT_PER_PAGE = 5
|
2024-08-01 13:28:09 +08:00
|
|
|
|
2024-07-29 11:43:52 +08:00
|
|
|
@staticmethod
|
|
|
|
def init_app(app):
|
|
|
|
pass
|
|
|
|
|
2024-08-01 13:28:09 +08:00
|
|
|
|
2024-07-29 11:43:52 +08:00
|
|
|
class DevelopmentConfig(Config):
|
2024-08-01 13:28:09 +08:00
|
|
|
DEBUG = True
|
|
|
|
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
|
|
|
|
'mysql+pymysql://root:123456@localhost/covid_detector'
|
|
|
|
|
2024-07-29 11:43:52 +08:00
|
|
|
|
|
|
|
class ProductionConfig(Config):
|
2024-08-01 13:28:09 +08:00
|
|
|
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
|
|
|
|
'mysql+pymysql://root:123456@localhost/covid_detector'
|
|
|
|
|
2024-07-29 11:43:52 +08:00
|
|
|
|
|
|
|
config = {
|
|
|
|
'development': DevelopmentConfig,
|
|
|
|
'production': ProductionConfig,
|
|
|
|
'default': DevelopmentConfig
|
|
|
|
}
|