feat: 添加日记系统

- 完整的 Django 后端 (diary app)
- 前端页面
- 部署脚本 (本地 + 云端)
- Nginx 配置
- 数据迁移工具
- 同步工具
This commit is contained in:
maoshen
2026-04-14 10:05:15 +00:00
parent 8e5ae8c7f1
commit 3dbf1ff6ce
31 changed files with 1457 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""添加第一条经验总结"""
import os
import sys
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'diary_system.settings')
sys.path.insert(0, '/root/.openclaw/workspace/diary-system/backend')
import django
django.setup()
from diary.models import Experience
# 创建第一条经验总结
exp = Experience.objects.create(
title="云服务器 Gunicorn 路径问题",
category="deployment",
problem="Gunicorn systemd 服务启动失败错误Failed to locate executable /usr/bin/gunicorn",
solution="1. 使用 pip3 install gunicorn 安装\n2. 查找 gunicorn 实际路径:/home/ubuntu/.local/bin/gunicorn\n3. 修改 systemd 服务文件,添加 Environment=PATH 并更新 ExecStart 路径",
lesson_learned="在云服务器上使用 pip 安装的包可能在用户目录,需要确认实际路径并在 systemd 中正确配置"
)
print(f"✅ 经验总结已创建:{exp.title}")
print(f" 类别:{exp.get_category_display()}")