2022-04-26 13:39:33 +00:00
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
from application.settings import BASE_DIR
|
|
|
|
|
|
2022-04-05 05:22:26 +00:00
|
|
|
|
# ================================================= #
|
2022-04-26 06:29:03 +00:00
|
|
|
|
# *************** mysql数据库 配置 *************** #
|
2022-04-05 05:22:26 +00:00
|
|
|
|
# ================================================= #
|
2022-04-26 13:39:33 +00:00
|
|
|
|
# 数据库 ENGINE ,默认演示使用 sqlite3 数据库,正式环境建议使用 mysql 数据库
|
|
|
|
|
# sqlite3 设置
|
|
|
|
|
DATABASE_ENGINE = "django.db.backends.sqlite3"
|
|
|
|
|
DATABASE_NAME = os.path.join(BASE_DIR, "db.sqlite3")
|
|
|
|
|
|
|
|
|
|
# 使用mysql时,改为此配置
|
|
|
|
|
# DATABASE_ENGINE = "django.db.backends.mysql"
|
|
|
|
|
# DATABASE_NAME = 'django-vue-admin' # mysql 时使用
|
|
|
|
|
|
2022-04-05 05:22:26 +00:00
|
|
|
|
# 数据库地址 改为自己数据库地址
|
2022-04-15 09:55:06 +00:00
|
|
|
|
DATABASE_HOST = "127.0.0.1"
|
2022-04-15 09:26:40 +00:00
|
|
|
|
# # 数据库端口
|
2022-04-15 09:55:06 +00:00
|
|
|
|
DATABASE_PORT = 3306
|
2022-04-15 09:26:40 +00:00
|
|
|
|
# # 数据库用户名
|
2022-04-15 09:55:06 +00:00
|
|
|
|
DATABASE_USER = "root"
|
2022-04-15 09:26:40 +00:00
|
|
|
|
# # 数据库密码
|
2022-04-15 09:55:06 +00:00
|
|
|
|
DATABASE_PASSWORD = "123456"
|
2022-04-15 09:26:40 +00:00
|
|
|
|
|
2022-04-26 06:29:03 +00:00
|
|
|
|
# 表前缀
|
2022-05-09 11:12:11 +00:00
|
|
|
|
TABLE_PREFIX = "sys_"
|
2022-04-05 05:22:26 +00:00
|
|
|
|
# ================================================= #
|
2022-04-26 06:29:03 +00:00
|
|
|
|
# ******** redis配置,无redis 可不进行配置 ******** #
|
2022-04-05 05:22:26 +00:00
|
|
|
|
# ================================================= #
|
|
|
|
|
# REDIS_PASSWORD = ''
|
|
|
|
|
# REDIS_HOST = '127.0.0.1'
|
|
|
|
|
# REDIS_URL = f'redis://:{REDIS_PASSWORD or ""}@{REDIS_HOST}:6380'
|
|
|
|
|
# ================================================= #
|
2022-04-26 06:29:03 +00:00
|
|
|
|
# ****************** 功能 启停 ******************* #
|
|
|
|
|
# ================================================= #
|
2022-05-10 07:09:40 +00:00
|
|
|
|
DEBUG = True
|
2022-04-26 13:40:41 +00:00
|
|
|
|
# 启动登录详细概略获取(通过调用api获取ip详细地址。如果是内网,关闭即可)
|
2022-04-26 06:29:03 +00:00
|
|
|
|
ENABLE_LOGIN_ANALYSIS_LOG = True
|
|
|
|
|
# 登录接口 /api/token/ 是否需要验证码认证,用于测试,正式环境建议取消
|
|
|
|
|
LOGIN_NO_CAPTCHA_AUTH = True
|
2022-04-05 05:22:26 +00:00
|
|
|
|
# ================================================= #
|
2022-04-26 06:29:03 +00:00
|
|
|
|
# ****************** 其他 配置 ******************* #
|
|
|
|
|
# ================================================= #
|
|
|
|
|
|
2022-04-05 05:22:26 +00:00
|
|
|
|
ALLOWED_HOSTS = ["*"]
|