Skip to content

feat: 自定义 404/500 错误页面#28

Open
xiokuai wants to merge 1 commit intoaba2222:mainfrom
xiokuai:feature/custom-error-pages
Open

feat: 自定义 404/500 错误页面#28
xiokuai wants to merge 1 commit intoaba2222:mainfrom
xiokuai:feature/custom-error-pages

Conversation

@xiokuai
Copy link
Copy Markdown
Contributor

@xiokuai xiokuai commented Feb 23, 2026

Summary

  • 添加自定义 404/500 错误页面,替换 Django 默认错误页
  • 毛玻璃卡片设计,每次访问随机显示背景图片
  • 独立 HTML 页面,不依赖 base.html(500 页面无模板上下文)

包含内容

  • forum/templates/404.html - 页面未找到
  • forum/templates/500.html - 服务器错误
  • forum/static/img/ - 19 张背景图片

毛玻璃卡片设计,随机背景图片
@xiokuai
Copy link
Copy Markdown
Contributor Author

xiokuai commented Feb 23, 2026

事实上,这个东西主要是写给我自己的,为了防止在coding时望着404疯掉m,颜控是胜利awa

@aba2222
Copy link
Copy Markdown
Owner

aba2222 commented Feb 23, 2026

图片不应该放在代码仓库中,尤其是大量的图片。(背景图片用处不大)
毛玻璃的设计风格和其他bootstrap的设计显得有些格格不入。
并且html应该继承base.html以统一导航栏的风格。

@aba2222
Copy link
Copy Markdown
Owner

aba2222 commented Feb 23, 2026

事实上,这个东西主要是写给我自己的,为了防止在coding时望着404疯掉m,颜控是胜利awa

实际上,开发(环境变量DEBUG=1)时404和500都会返回详细错误信息:)

@xiokuai
Copy link
Copy Markdown
Contributor Author

xiokuai commented Feb 23, 2026

我知道,但这个能让我心情变好,这很重要!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants