feat: base 将配置文件放到单独的config文件夹中防止误操作
This commit is contained in:
parent
cbc667d50c
commit
74581dc906
|
@ -20,6 +20,8 @@ db.sqlite3
|
|||
server/conf*.py
|
||||
server/conf.ini
|
||||
server/conf*.json
|
||||
config/conf*.py
|
||||
config/conf*.json
|
||||
sh/*
|
||||
temp/*
|
||||
nohup.out
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
SECRET_KEY = 'xx'
|
||||
DEBUG = False
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'xx',
|
||||
'USER': 'postgres',
|
||||
'PASSWORD': 'xx',
|
||||
'HOST': 'xx',
|
||||
'PORT': '5432',
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
from . import conf
|
||||
from config import conf
|
||||
from celery import Celery
|
||||
from celery.app.control import Control, Inspect
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ from datetime import datetime, timedelta
|
|||
import os
|
||||
import json
|
||||
import sys
|
||||
from .conf import *
|
||||
from config.conf import *
|
||||
from django.core.cache import cache
|
||||
import logging
|
||||
|
||||
|
@ -369,7 +369,7 @@ LOGGING = {
|
|||
}
|
||||
|
||||
##### 加载客户可自定义配置并提供操作方法 #####
|
||||
SYS_JSON_PATH = os.path.join(BASE_DIR, 'server/conf.json')
|
||||
SYS_JSON_PATH = os.path.join(BASE_DIR, 'config/conf.json')
|
||||
|
||||
def get_sysconfig(key='', default='raise_error', reload=False):
|
||||
"""获取系统配置可指定key字符串
|
||||
|
|
Loading…
Reference in New Issue