2021-11-30 15:55:50 +08:00
|
|
|
import os.path
|
|
|
|
|
|
|
|
# 项目目录
|
|
|
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
2021-11-29 11:09:21 +08:00
|
|
|
|
2021-12-01 11:01:14 +08:00
|
|
|
SECRET_KEY = 'cf036e50524a11ecb4a618c04d9eb245'
|
|
|
|
|
2021-12-01 14:23:58 +08:00
|
|
|
JSONIFY_PRETTYPRINT_REGULAR = False
|
|
|
|
RESTFUL_JSON = {'separators': (',', ':'), 'indent': 0}
|
|
|
|
|
2021-11-29 11:09:21 +08:00
|
|
|
# mongodb 地址
|
|
|
|
MONGODB_SETTINGS = {
|
|
|
|
'host': 'mongodb://admin:111111@10.2.2.10:27017/ops_api?authSource=admin',
|
|
|
|
}
|
2021-11-30 15:55:50 +08:00
|
|
|
|
2021-12-01 11:01:14 +08:00
|
|
|
# API static token 允许请求的静态token
|
|
|
|
X_TOKEN_SET = (
|
|
|
|
"51ab21fa323a11eca1af000c2993d583", #
|
|
|
|
)
|
|
|
|
|
2021-11-30 15:55:50 +08:00
|
|
|
LOGGING = {
|
|
|
|
'version': 1,
|
|
|
|
'disable_existing_loggers': True,
|
|
|
|
'formatters': {
|
|
|
|
'verbose': {
|
|
|
|
'format': '%(asctime)s %(levelname)s %(module)s:%(funcName)s %(process)d %(thread)d %(message)s'
|
|
|
|
},
|
|
|
|
'simple': {
|
|
|
|
'format': '%(levelname)s %(message)s'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'filters': {
|
|
|
|
},
|
|
|
|
'handlers': {
|
|
|
|
'console': {
|
|
|
|
'level': 'DEBUG',
|
|
|
|
'class': 'logging.StreamHandler',
|
|
|
|
'formatter': 'simple'
|
|
|
|
},
|
|
|
|
'file_app': {
|
|
|
|
'level': 'DEBUG',
|
|
|
|
'class': 'logging.handlers.RotatingFileHandler',
|
|
|
|
'filename': os.path.join(os.path.dirname(BASE_DIR), 'logs/app.log'),
|
|
|
|
'encoding': 'utf-8',
|
|
|
|
'maxBytes': 1024 * 1024 * 5,
|
|
|
|
'backupCount': 5,
|
|
|
|
'formatter': 'verbose'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'loggers': {
|
|
|
|
'root': {
|
|
|
|
'handlers': ['file_app'],
|
|
|
|
'level': 'DEBUG',
|
|
|
|
'propagate': True,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|