Skip to content

Commit 3b1c052

Browse files
committed
[add]增加后端配置文件样例
1 parent 5ccf5d7 commit 3b1c052

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.env.example

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This file is used to store the environment variables for the project
2+
# drf基础配置
3+
SECRET_KEY="djangopassword"
4+
DEBUG=False
5+
ALLOWED_HOSTS=localhost,127.0.0.1
6+
7+
# 数据库配置
8+
DB_ENGINE="mysql"
9+
# DB_ENGINE="sqlite3"
10+
DB_NAME="puredrf"
11+
DB_USER="puredrf"
12+
DB_PASSWORD="puredrf"
13+
DB_HOST="127.0.0.1"
14+
DB_PORT="3306"
15+
16+
# redis配置
17+
# USE_REDIS=True
18+
USE_REDIS=False
19+
# 本地redis地址
20+
REDIS_HOST="redis://127.0.0.1:6379/1"
21+
# REDIS_PASSWORD="puredrf"
22+
23+
# 日志配置
24+
API_LOG_ENABLE=True
25+
API_LOG_METHODS="POST,PUT,DELETE"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ pip-delete-this-directory.txt
1616
.DS_Store
1717

1818
# 环境变量文件,开发时使用,生成部署时改为环境变量
19-
# .env
19+
.env

0 commit comments

Comments
 (0)