|
|
|
|
@ -272,7 +272,7 @@ def refresh_memcache(request):
|
|
|
|
|
|
|
|
|
|
def page_not_found_view(request, exception, template_name='blog/error_page.html'):
|
|
|
|
|
if exception:
|
|
|
|
|
logger.error(exception)
|
|
|
|
|
logger.warn(exception)
|
|
|
|
|
url = request.get_full_path()
|
|
|
|
|
return render(request, template_name,
|
|
|
|
|
{'message': '哎呀,您访问的地址 ' + url + ' 是一个未知的地方。请点击首页看看别的?', 'statuscode': '404'}, status=404)
|
|
|
|
|
@ -280,11 +280,11 @@ def page_not_found_view(request, exception, template_name='blog/error_page.html'
|
|
|
|
|
|
|
|
|
|
def server_error_view(request, template_name='blog/error_page.html'):
|
|
|
|
|
return render(request, template_name,
|
|
|
|
|
{'message': '哎呀,出错了,我已经收集到了错误信息,之后会抓紧抢修,请点击首页看看别的?', 'statuscode': '500'})
|
|
|
|
|
{'message': '哎呀,出错了,我已经收集到了错误信息,之后会抓紧抢修,请点击首页看看别的?', 'statuscode': '500'}, status=500)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def permission_denied_view(request, exception, template_name='blog/error_page.html'):
|
|
|
|
|
if exception:
|
|
|
|
|
logger.error(exception)
|
|
|
|
|
logger.warn(exception)
|
|
|
|
|
return render(request, template_name,
|
|
|
|
|
{'message': '哎呀,您没有权限访问此页面,请点击首页看看别的?', 'statuscode': '403'})
|
|
|
|
|
{'message': '哎呀,您没有权限访问此页面,请点击首页看看别的?', 'statuscode': '403'}, status=403)
|
|
|
|
|
|