设置了ALLOWED_HOSTS,以及handler404,在view里面定义了page_not_found了。
url:
handler404 = “users.views.page_not_found”
view:
def page_not_found(request):
#全局404处理函数
from django.shortcuts import render_to_response
response = render_to_response("webapp/404.html", {})
response.status_code = 404
return response
版本:django2.0.6
求解。