ops-api/settings/dev.py

56 lines
1.4 KiB
Python
Raw Normal View History

import os.path
# 项目目录
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'cf036e50524a11ecb4a618c04d9eb245'
2021-12-01 14:23:58 +08:00
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',
}
# redis 地址
REDIS_URL = "redis://:@10.2.2.10:6379/1"
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,
},
}
}