【发布时间】:2023-03-12 18:15:01
【问题描述】:
在我的urls.py 文件中,我有以下内容:
def error_404(request): return render(request, 'shop/errors/404.html')
def error_500(request): return render(request, 'shop/errors/500.html')
handler404 = error_404
handler500 = error_500
但是,当我输入随机网址时,例如“mysite.com/lhazeglazd”,会返回 500 错误页面。
是什么导致 500 错误覆盖我的 404 错误?
【问题讨论】:
标签: django error-handling http-status-code-404