refactor: 重构配置文件

所有项目的app都放在env.py里的CUSTOM_APPS列表里注册,为了支持按照项目app查找model
This commit is contained in:
ahhui
2023-08-03 18:04:34 +08:00
committed by 李强
parent d59df6db7c
commit 7c27f95353
4 changed files with 33 additions and 6 deletions

View File

@@ -55,10 +55,10 @@ INSTALLED_APPS = [
"rest_framework",
"django_filters",
"corsheaders", # 注册跨域app
"dvadmin.system",
"drf_yasg",
"captcha",
'channels',
*locals().get("CUSTOM_APPS", []), # 所有项目里写的app需要在env.py文件里的CUSTOM_APPS中
]
MIDDLEWARE = [
@@ -306,7 +306,7 @@ AUTHENTICATION_BACKENDS = ["dvadmin.utils.backends.CustomBackend"]
# ================================================= #
SIMPLE_JWT = {
# token有效时长
"ACCESS_TOKEN_LIFETIME": timedelta(minutes=120),
"ACCESS_TOKEN_LIFETIME": timedelta(minutes=1440),
# token刷新后的有效时间
"REFRESH_TOKEN_LIFETIME": timedelta(days=1),
# 设置前缀