RODY/app/configs/default.py

30 lines
793 B
Python
Raw Normal View History

2022-11-04 17:37:08 +08:00
import os
# 根目录
ROOT_PATH = os.path.split(os.path.abspath(__name__))[0]
# 开启debug
DEBUG = True
# 密钥
SECRET_KEY = 'WugjsfiYBEVsiQfiSwEbIOEAGnOIFYqoOYHEIK'
# 数据库配置
# SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://deepLearner:dp2021@124.71.203.3:5432/demo'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://demo:demo123@192.168.2.9:3306/flask_demo'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# 查询时会显示原始SQL语句
SQLALCHEMY_ECHO = True
# SQLALCHEMY_DATABASE_URI = 'sqlite:///{}'.format(os.path.join(ROOT_PATH, 'demo.db'))
# SQLALCHEMY_TRACK_MODIFICATIONS = False
# 数据库配置
db = {
'host': '127.0.0.1',
'user': 'root',
'password': '',
'port': 6379,
'database': 'school',
'charset': 'utf8',
'db': 0
}