diff --git a/config/e.conf.py b/config/e.conf.py deleted file mode 100644 index b6175ee6..00000000 --- a/config/e.conf.py +++ /dev/null @@ -1,12 +0,0 @@ -SECRET_KEY = 'xx' -DEBUG = False -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'xx', - 'USER': 'postgres', - 'PASSWORD': 'xx', - 'HOST': 'xx', - 'PORT': '5432', - } -} diff --git a/db.json b/db.json new file mode 100644 index 00000000..c930b1b0 Binary files /dev/null and b/db.json differ diff --git a/readme.md b/readme.md index aeaf19ca..055f27ad 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,17 @@ ## 如何运行 -将 server 下的 conf_e.json 以及 conf_e.py,重名名为 conf.json 和 conf.py。 +将 server 下的 conf_e.json 以及 conf_e.py,移动到config文件夹下并重命名为 conf.json 和 conf.py。 根据自己的情况修改参数 +进入虚拟环境后运行 python manage.py migrate + +导入初始数据 python manage.py loaddata db.json + +默认管理员账户密码为admin xtadmin123! + 在项目目录下执行 python manage.py runserver 即可 运行后在 localhost:8000/api/swagger/下查看 api 文档 + + diff --git a/server/conf_e.json b/server/conf_e.json index 864f21f6..990ff11c 100644 --- a/server/conf_e.json +++ b/server/conf_e.json @@ -3,7 +3,8 @@ "base_name": "xx平台", "base_logo": "/media/default/logo.png", "base_name_short": "xx", - "base_logo_side": "" + "base_logo_side": "", + "base_menucate": "dynamic" }, "apk": { "apk_version": "1.0", diff --git a/server/conf_e.py b/server/conf_e.py index cb5b416d..7b16fc6d 100644 --- a/server/conf_e.py +++ b/server/conf_e.py @@ -14,7 +14,12 @@ EMAIL_USE_TLS = True # 数据库配置 -CACHE_LOCATION = "redis://127.0.0.1:6379/2" +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.redis.RedisCache', + 'LOCATION': 'redis://127.0.0.1:6379/2', # Redis URL + } +} CELERY_BROKER_URL = "redis://127.0.0.1:6379/3" CELERY_TASK_DEFAULT_QUEUE = BASE_PROJECT_CODE DEBUG = True @@ -32,11 +37,6 @@ DATABASES = { # 雪花ID SNOW_DATACENTER_ID = 1 -# 百度语音 -BD_SP_ID = 'xx' -BD_SP_KEY = 'xx' -BD_SP_SECRET = 'xx' - # 运维相关 SD_PWD = 'xx' BACKUP_PATH = '/home/xx/xx/xx'