55 lines
1.3 KiB
Python
55 lines
1.3 KiB
Python
import os.path
|
|
|
|
# 项目目录
|
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
SECRET_KEY = 'cf036e50524a11ecb4a618c04d9eb245'
|
|
|
|
# mongodb 地址
|
|
MONGODB_SETTINGS = {
|
|
'host': 'mongodb://admin:111111@10.2.2.10:27017/ops_api?authSource=admin',
|
|
}
|
|
|
|
# API static token 允许请求的静态token
|
|
X_TOKEN_SET = (
|
|
"51ab21fa323a11eca1af000c2993d583", #
|
|
)
|
|
|
|
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,
|
|
},
|
|
}
|
|
}
|