67 lines
1.8 KiB
Markdown
67 lines
1.8 KiB
Markdown
# AGENTS.md — blog (六桂流芳的com)
|
|
|
|
## Tech stack
|
|
|
|
- Python 3.12.7, Django 5.1, SQLite (dev) / PostgreSQL (prod via `psycopg2-binary`)
|
|
- `zh-Hans` locale, `Asia/Shanghai` timezone
|
|
|
|
## Key commands
|
|
|
|
Run from `myblog/`:
|
|
|
|
```bash
|
|
python manage.py runserver # dev server
|
|
python manage.py makemigrations # after model changes
|
|
python manage.py migrate # apply migrations
|
|
python manage.py createsuperuser # admin login
|
|
python manage.py collectstatic # prod: gather static files to staticfiles/
|
|
```
|
|
|
|
## Package management
|
|
|
|
```bash
|
|
pip install -r requirements.txt # sync deps (no lockfile)
|
|
```
|
|
|
|
`uv` (v0.8.3) is in requirements.txt but not the primary workflow.
|
|
|
|
## Project layout
|
|
|
|
```
|
|
myblog/
|
|
├── blog/ # main app (models, views, templates, admin)
|
|
│ └── static/blog/ # shared CSS (single style.css)
|
|
├── myblog/ # Django project settings/settings.py
|
|
├── manage.py
|
|
├── db.sqlite3 # dev DB (gitignored)
|
|
└── media/ # user uploads (gitignored)
|
|
```
|
|
|
|
## Key models
|
|
|
|
- `Post` — `title`, `content` (MDEditor), `category` (FK), `status` (draft/published), `publish_date`
|
|
- `Category` — `name`, `description`
|
|
- `SiteSettings` — singleton: `summary_length`, contact fields
|
|
|
|
Admin at `/admin/` with MDEditor on Post content field.
|
|
|
|
## Local overrides
|
|
|
|
Create `myblog/myblog/local_settings.py` to override any setting. Imported at the bottom of `settings.py`.
|
|
|
|
## Git workflow
|
|
|
|
```
|
|
feature/* or bugfix/* → develop → main
|
|
```
|
|
|
|
Remote: `ssh://git@git.yuangyaa.com:222/yuangyaa/blog.git`
|
|
|
|
## What's NOT configured
|
|
|
|
- **No tests** (tests.py is blank)
|
|
- **No linting, formatting, or type checking**
|
|
- **No CI/CD**
|
|
- **No pre-commit hooks**
|
|
- **No Docker**
|