config.py
899 字节
# -*- coding=utf-8 -*-
import os
from datetime import timedelta
class Config:
SECRET_KEY = 'smiotms'
SQLALCHEMY_TRACK_MODIFICATIONS = True
PERMANENT_SESSION_LIFETIME = timedelta(minutes=300)
UP_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "app/static/uploads/") # 文件上传路径
FC_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "app/static/uploads/users/") # 用户头像上传路径
AL_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "app/static/uploads/alarms/") # 报警上传路径
#
POST = 'POST'
GET = 'GET'
@staticmethod
def init_app(app):
pass
# the config for development
class DevelopmentConfig(Config):
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:admin123@127.0.0.1:3306/smiotms'
DEBUG = True
# define the config
config = {
'default': DevelopmentConfig
}