Files
diary-system/create_first_entry.py
maoshen b273789ae8 Initial commit: 日记系统
完整的日记记录系统
- Django 后端 (diary app)
- 前端页面
- 部署脚本 (本地 + 云端)
- Nginx 配置
- 数据迁移和同步工具
2026-04-14 10:07:27 +00:00

32 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
import os
import sys
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'diary_system.settings')
sys.path.insert(0, '/home/ubuntu/diary-system/backend')
import django
django.setup()
from diary.models import DiaryEntry
from datetime import date
entry, created = DiaryEntry.objects.get_or_create(date=date.today())
entry.title = "第一天 - 日记系统上线"
entry.completed_tasks = """- 创建日记系统框架
- 开发 Web 日记系统Django + 轻量前端)
- 配置 Nginx 反向代理
- 数据库迁移和同步
- 部署到云服务器"""
entry.learned = """- 掌握了 Django 项目快速搭建
- 学习了 Nginx 配置和权限管理
- 解决了云服务器部署问题"""
entry.reflections = """- 日记系统应该保持简洁,避免过度设计
- 每天记录进步可以帮助持续改进"""
entry.improvements = """1. 系统建设:建立了日记系统的基础框架
2. Web 开发:独立完成全栈 Web 应用开发
3. 问题解决:快速解决权限和部署问题"""
entry.save()
print(f"✅ 日记已创建:{entry.date}")
print(f" 标题:{entry.title}")