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'
|
|
|
|
|
|
|
|
# 数据库配置
|
2022-11-08 10:02:42 +08:00
|
|
|
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'
|
2022-11-04 17:37:08 +08:00
|
|
|
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',
|
2022-11-08 10:02:42 +08:00
|
|
|
'password': 'sdust2020',
|
2022-11-04 17:37:08 +08:00
|
|
|
'port': 6379,
|
|
|
|
'database': 'school',
|
|
|
|
'charset': 'utf8',
|
|
|
|
'db': 0
|
|
|
|
}
|