http://127.0.0.1:8000/app/slug/
随着Debug=True我得到Page not found (404) - No entry found matching the query. 随着Debug=False我得到显示projectName/templates/500.html而不是404.html.
两者看起来完全一样。500.html:
{% extends "base.html" %}
{% block title %}server error{% endblock %}
{% block content %}
<h3>Error 500: server error</h3>
{% endblock %}
404.html:
{% extends "base.html" %}
{% block title %}page not found{% endblock %}
{% block content %}
<h3>Error 404: page not found</h3>
{% endblock %}
为什么 Django 加载 500 而不是 404 虽然它存在?不能是模板错误。