forked from Machnlea/inventory-system-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
62 lines (50 loc) · 1.67 KB
/
.env.example
File metadata and controls
62 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# ===========================================
# 设备台账管理系统环境变量配置
# ===========================================
# 数据库配置
# SQLite (默认,开发环境使用)
# DATABASE_URL=sqlite:///./inventory.db
# PostgreSQL (生产环境推荐)
# 格式: postgresql://用户名:密码@主机:端口/数据库名
DATABASE_URL=postgresql://inventory_user:your_secure_password@localhost:5432/inventory_system
# PostgreSQL 连接参数 (可选)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=inventory_system
DB_USER=inventory_user
DB_PASSWORD=your_secure_password
# 应用安全配置
SECRET_KEY=your-very-secure-secret-key-change-this-in-production-please-use-a-long-random-string
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_HOURS=2
# 管理员账户配置
ADMIN_USERNAME=admin
ADMIN_PASSWORD=your_secure_admin_password
# 文件上传配置
UPLOAD_DIR=./app/static/uploads
MAX_FILE_SIZE=10485760 # 10MB
ALLOWED_EXTENSIONS=.jpg,.jpeg,.png,.pdf,.xlsx,.xls,.doc,.docx
# 应用配置
DEBUG=False
HOST=0.0.0.0
PORT=8000
# 日志配置
LOG_LEVEL=INFO
LOG_FILE=./data/app.log
# 邮件配置 (可选,用于通知功能)
# SMTP_SERVER=smtp.gmail.com
# SMTP_PORT=587
# SMTP_USERNAME=your-email@gmail.com
# SMTP_PASSWORD=your-app-password
# EMAIL_FROM=your-email@gmail.com
# Redis 配置 (可选,用于缓存)
# REDIS_URL=redis://localhost:6379/0
# CORS 配置 (可选)
# ALLOWED_ORIGINS=http://localhost:3000,https://your-domain.com
# ===========================================
# 使用说明:
# 1. 复制此文件为 .env
# 2. 修改各项配置值
# 3. 确保 DATABASE_URL 和 SECRET_KEY 已设置
# 4. 生产环境务必修改默认密码和密钥
# ===========================================