删除mongodb配置

pull/6/MERGE
李强 2021-03-27 20:37:08 +08:00
parent bc19d5c29f
commit 1f5f0478da
2 changed files with 4 additions and 9 deletions

View File

@ -239,7 +239,6 @@ else:
} }
} }
connect(MONGO_DATABASE_NAME, host=os.getenv('MONGO_HOST') or MONGO_HOST, port=MONGO_PORT, serverSelectionTimeoutMS=1000, connect=False)
# redis 缓存 # redis 缓存
REDIS_URL = f'redis://:{REDIS_PASSWORD if REDIS_PASSWORD else ""}@{os.getenv("REDIS_HOST") or REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}' REDIS_URL = f'redis://:{REDIS_PASSWORD if REDIS_PASSWORD else ""}@{os.getenv("REDIS_HOST") or REDIS_HOST}:{REDIS_PORT}/{REDIS_DB}'
CACHES = { CACHES = {
@ -320,5 +319,6 @@ CAPTCHA_CHALLENGE_FUNCT = 'captcha.helpers.math_challenge'
API_LOG_ENABLE = True API_LOG_ENABLE = True
# API_LOG_METHODS = 'ALL' # ['POST', 'DELETE'] # API_LOG_METHODS = 'ALL' # ['POST', 'DELETE']
# API_LOG_METHODS = ['POST', 'DELETE'] # ['POST', 'DELETE'] # API_LOG_METHODS = ['POST', 'DELETE'] # ['POST', 'DELETE']
BROKER_URL = f'redis://:{REDIS_PASSWORD if REDIS_PASSWORD else ""}@{os.getenv("REDIS_HOST") or REDIS_HOST}:{REDIS_PORT}/2' #Broker使用Redis, 使用0数据库(暂时不是很清楚原理) BROKER_URL = f'redis://:{REDIS_PASSWORD if REDIS_PASSWORD else ""}@{os.getenv("REDIS_HOST") or REDIS_HOST}:' \
f'{REDIS_PORT}/{locals().get("CELERY_DB",2)}' #Broker使用Redis
CELERYBEAT_SCHEDULER = 'django_celery_beat.schedulers.DatabaseScheduler' #Backend数据库 CELERYBEAT_SCHEDULER = 'django_celery_beat.schedulers.DatabaseScheduler' #Backend数据库

View File

@ -15,13 +15,6 @@ DATABASE_PASSWORD = "q1w2e3r4T%Y^U&MYSQL"
# 数据库名 # 数据库名
DATABASE_NAME = "django-vue-admin" DATABASE_NAME = "django-vue-admin"
# ================================================= #
# ************** mongodb 数据库配置 ************** #
# ================================================= #
MONGO_DATABASE_NAME = 'django-vue-admin'
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
# ================================================= # # ================================================= #
# ************** redis 数据库配置 ************** # # ************** redis 数据库配置 ************** #
# ================================================= # # ================================================= #
@ -29,6 +22,8 @@ REDIS_DB = 1
REDIS_HOST = '127.0.0.1' REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379 REDIS_PORT = 6379
REDIS_PASSWORD = 'q1w2e3r4T%Y^U&' REDIS_PASSWORD = 'q1w2e3r4T%Y^U&'
# celery 定时任务redis 库号
CELERY_DB = 2
# ================================================= # # ================================================= #
# ************** 默认配置 ************** # # ************** 默认配置 ************** #