45 lines
2.2 KiB
Python
45 lines
2.2 KiB
Python
|
from redis import StrictRedis
|
|||
|
|
|||
|
|
|||
|
# 全局通用配置类
|
|||
|
class Config(object):
|
|||
|
"""项目配置核心类"""
|
|||
|
# 调试模式
|
|||
|
DEBUG = True
|
|||
|
|
|||
|
# todo 配置日志
|
|||
|
LOG_LEVEL = "DEBUG"
|
|||
|
|
|||
|
# mysql数据库配置信息(指定字符集?charset=utf8)
|
|||
|
# 数据库连接格式
|
|||
|
'SQLALCHEMY_DATABASE_URI ="数据库类型://用户名:密码@ip:port:库名?指定字符集编码"'
|
|||
|
# SQLALCHEMY_DATABASE_URI = "postgresql://postgres:123456@192.168.2.139:5432/students?charset=utf8"
|
|||
|
# # 动态追踪修改设置,如未设置只会提示警告
|
|||
|
# SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|||
|
# # 查询时会显示原始SQL语句
|
|||
|
# SQLALCHEMY_ECHO = False
|
|||
|
#
|
|||
|
# # 配置redis
|
|||
|
# # 项目上线以后,这个地址就会被替换成真实IP地址,mysql也是
|
|||
|
# CACHE_TYPE = 'redis'
|
|||
|
# CACHE_REDIS_HOST = 'localhost'
|
|||
|
# CACHE_REDIS_PORT = 6379
|
|||
|
# CACHE_REDIS_DB = '8'
|
|||
|
# CACHE_REDIS_PASSWORD = 'sdust2020'
|
|||
|
#
|
|||
|
# # 设置session 秘钥
|
|||
|
# # 可以通过 base64.b64encode(os.urandom(48)) 来生成一个指定长度的随机字符串
|
|||
|
# SECRET_KEY = "CF3tEA1J3hRyIOw3PWE3ZE9+hLOcUDq6acX/mABsEMTXNjRDm5YldRLIXazQviwP"
|
|||
|
#
|
|||
|
# # flask_session的配置信息
|
|||
|
# SESSION_TYPE = 'redis' # 指定session保存到redis中
|
|||
|
# SESSION_USE_SIGNER = True # 让 cookie 中的 session_id 被加密签名处理
|
|||
|
# SESSION_REDIS = StrictRedis(host=CACHE_REDIS_HOST, port=CACHE_REDIS_PORT) # 使用 redis 的实例
|
|||
|
# PERMANENT_SESSION_LIFETIME = 24 * 60 * 60 # session 的有效期,单位是秒
|
|||
|
XML_PATH = 'C:/Users/HP/Desktop/Number tube/test' # xml存储路径
|
|||
|
THUMBNAIL_PATH = 'C:/Users/HP/Desktop/Number tube/test' # 拇指图存储路径
|
|||
|
DFS_UPLOAD_URL = 'http://192.168.2.9:4096/group1/upload' # 文件服务器请求路径
|
|||
|
RESING_DATA_URL = 'http://192.168.2.9:8820/api/remote-sensing-data/add' # 入库遥感数据请求地址
|
|||
|
DATA_TASK_URL = 'http://192.168.2.9:8820/api/data-storage-task-record/add' # 添加遥感数据归档任务请求地址
|
|||
|
DATA_END_TASK_URL = 'http://192.168.2.9:8820/api/data-storage-task-record/end' # 结束遥感数据归档任务请求地址
|