No description
  • Python 41.5%
  • Rust 35.5%
  • TypeScript 16.7%
  • HTML 2.5%
  • CSS 1.4%
  • Other 2.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-08 17:30:00 +00:00
.agents/skills/frontend-architecture docs: update agent docs 2026-09-23 15:33:15 +08:00
.config chore(gitops): update image tags to fc5f82d [skip ci] 2026-10-08 17:30:00 +00:00
.github/workflows chore!: env BACKEND_DOMAIN -> DOMAIN 2026-08-19 14:11:06 +08:00
.woodpecker fix: restore scroll position on swap 2026-10-05 22:08:23 +08:00
accounts fix(test): add 'image_metadata' cache alias 2026-09-01 20:26:45 +08:00
api refactor!: migrate api auto to api_client 2026-10-04 10:07:32 +08:00
blog chore: adjust image frame limit 2026-10-09 01:06:20 +08:00
core refactor: settings 2026-08-19 14:02:59 +08:00
media_service chore: adjust image frame limit 2026-10-09 01:06:20 +08:00
native feat: model viewer 2026-09-23 12:34:54 +08:00
scripts refactor: email backend 2026-08-24 17:47:16 +08:00
templates/admin feat: accounts 2026-08-15 21:48:58 +08:00
web chore: recover index.html 2026-10-05 22:10:57 +08:00
.clang-format WIP: basic music islands structure 2026-08-16 16:01:40 +08:00
.dockerignore feat: native crc64nvme 2026-08-09 11:00:09 +08:00
.editorconfig fix: cdn cache audit 2026-08-17 17:44:59 +08:00
.env.example chore!: env BACKEND_DOMAIN -> DOMAIN 2026-08-19 14:11:06 +08:00
.gitattributes chore: add .editorconfig and .gitattributes 2026-03-09 21:12:31 +08:00
.gitignore fix: cdn cache audit 2026-08-17 17:44:59 +08:00
.oxfmtrc.jsonc fix: disable oxfmt on 'web/templates/web/pages/blog.md' 2026-09-23 12:51:35 +08:00
.python-version chore: update to python 3.14 2026-01-14 10:42:49 +08:00
AGENTS.md fix: animated avif & webp 2026-09-23 15:05:20 +08:00
compose.yml pref: db tuning & orjson parse 2026-07-08 10:40:16 +08:00
LICENSE fix: add Anime model; 2025-06-24 21:30:53 +08:00
manage.py style: apply ruff codestyle 2026-01-23 19:49:21 +08:00
package.json fix: restore scroll position on swap 2026-10-05 22:08:23 +08:00
playwright.config.ts fix: restore scroll position on swap 2026-10-05 22:08:23 +08:00
pnpm-lock.yaml chore: update packages 2026-10-03 22:54:04 +08:00
pyproject.toml chore: clean python side markdown postprocess 2026-08-31 20:16:39 +08:00
README.md docs: update agent docs 2026-08-17 10:42:56 +08:00
THIRD_PARTY_LICENSES feat: music player 2026-09-11 22:46:24 +08:00
tsconfig.e2e.json refactor: e2e test default port 2026-08-10 14:37:29 +08:00
tsconfig.json fix: skip ts lib check 2026-08-28 19:25:39 +08:00
uv.lock chore: update packages 2026-10-03 22:54:04 +08:00
vite.config.mts feat: music player 2026-09-11 22:46:24 +08:00

GSGFs-blog

status-badge

使用 Django 构建的个人网站.

运行

Note

Django 自带的后台在 /not-admin 而不是 /admin

python版本: 3.14, 使用 uv 作为包管理器

  1. 安装所需依赖

    uv sync
    pnpm i
    
  2. 激活 Python 虚拟环境 (以 Linux 为例)

    source .venv/bin/activate
    
  3. 将 .env.example 复制一份为 .env 并填写需要的环境变量

    尖括号中的内容是必填项, 可以使用 openssl rand -hex 40 生成所需的随机字符

  4. 启动数据库和 Redis

    docker compose up -d "blog-postgres" "blog-redis"
    
  5. (可选) 由于搜索功能依赖向量化处理, 需要下载用于生成向量的嵌入模型

    ./scripts/download-model.py
    
  6. 迁移数据库

    ./manage.py migrate
    
  7. 创建一个管理员用户 (用于登陆后台)

    ./manage.py createsuperuser
    
  8. 运行开发服务器

    # 运行 vite
    ./manage.py vite # 或者 pnpm run dev
    # 新开一个终端, 运行 Django ASGI 开发服务器
    ./manage.py runasgi
    

可选依赖

  • ExifTool: 用于清理上传图片的 EXIF 元数据. 如果系统中安装了 exiftool, 后端会自动调用它来处理图片以保护隐私. 如果没有, 则使用 PIL 对图片进行重编码来去除 EXIF 信息.
    • Arch Linux: sudo pacman -S perl-image-exiftool
    • Debian/Ubuntu: sudo apt install libimage-exiftool-perl

目录

.
├── api/            # Django app
│   ├── backends/   # Django 后端
│   ├── migrations/ # 数据库迁移
│   ├── routers/    # 路由
│   ├── tests/      # 测试
│   ├── admin.py    # Django admin 设置
│   ├── apps.py     # Django app 设置
│   ├── models.py   # Django ORM
│   ├── schemas.py  # schema 定义
│   ├── signals.py  # Django 信号处理
│   ├── tasks.py     # celery 任务
│   └── urls.py     # URL 汇总
├── blog/           # Django project
├── scripts/        # 辅助脚本
├── templates/      # Django 模板
├── web/            # 前端 app
└── manage.py       # Django cli

接口文档

django-ninja 自带 swagger-UI, 启动后访问 /api/docs

开源协议

MIT