sforkowany z mtyton/comfy
add http400 handler
rodzic
3c7b1fbc74
commit
fe431189d8
|
@ -12,6 +12,7 @@ from wagtail.documents import urls as wagtaildocs_urls
|
|||
|
||||
from search import views as search_views
|
||||
|
||||
handler400 = 'artel.views.my_custom_bad_request_view'
|
||||
handler404 = 'artel.views.my_custom_page_not_found_view'
|
||||
|
||||
|
||||
|
|
|
@ -7,5 +7,8 @@ def my_custom_page_not_found_view(*args, **kwargs):
|
|||
if settings.SENTRY_ENVIRONMENT != 'production':
|
||||
capture_message("Page not found!", level="error")
|
||||
|
||||
# return any response here, e.g.:
|
||||
return HttpResponseNotFound("Not found")
|
||||
|
||||
def my_custom_bad_request_view(*args, **kwargs):
|
||||
capture_message("Bad request!", level="error")
|
||||
return HttpResponseBadRequest("Bad request")
|
||||
|
|
Ładowanie…
Reference in New Issue