refactor: 优化配置文件的app配置

This commit is contained in:
china_ahhui
2023-11-13 18:27:10 +08:00
parent b74a196c94
commit 96748da99d
2 changed files with 3 additions and 5 deletions

View File

@@ -46,7 +46,7 @@ ALLOWED_HOSTS = locals().get("ALLOWED_HOSTS", ["*"])
# Application definition # Application definition
CUSTOM_APPS = [ CUSTOM_APPS = [
"dvadmin.system", "dvadmin.system",
] ] + CUSTOM_APPS
INSTALLED_APPS = [ INSTALLED_APPS = [
"django.contrib.auth", "django.contrib.auth",
@@ -61,7 +61,7 @@ INSTALLED_APPS = [
"drf_yasg", "drf_yasg",
"captcha", "captcha",
'channels', 'channels',
*locals().get("CUSTOM_APPS", []), # 所有项目里写的app需要在env.py文件里的CUSTOM_APPS中 *CUSTOM_APPS,
] ]
MIDDLEWARE = [ MIDDLEWARE = [

View File

@@ -44,6 +44,4 @@ LOGIN_NO_CAPTCHA_AUTH = True
# ================================================= # # ================================================= #
ALLOWED_HOSTS = ["*"] ALLOWED_HOSTS = ["*"]
CUSTOM_APPS = [ CUSTOM_APPS = []
"dvadmin.system",
]