【发布时间】:2020-06-16 09:28:50
【问题描述】:
我正在尝试通过将我的 500.html 文件放在模板文件夹中来为我的 django 应用程序定义一个自定义的 500 错误。
{% extends "base.html" %}
{% load static %}
{% block body %}
<div class="container">
<div class="row">
UPS, algo fue mal.
</div>
</div>
{% endblock %}
没有第一行(扩展网络的骨架)它可以工作,但是有了它我得到了这个消息:
A server error occurred. Please contact the administrator.
我正在为 404 错误做同样的事情,而且我工作得很好。我完全迷路了。
【问题讨论】:
标签: python django django-templates http-status-code-500