ops-api/settings/dev.py

53 lines
1.3 KiB
Python

import os.path
# 项目目录
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'cf036e50524a11ecb4a618c04d9eb245'
JSONIFY_PRETTYPRINT_REGULAR = False
RESTFUL_JSON = {'separators': (',', ':'), 'indent': 0}
# mongodb 地址
MONGODB_SETTINGS = {
'host': 'mongodb://admin:111111@10.2.2.10:27017/ops_api?authSource=admin',
}
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,
},
}
}