API Documentation
django_easy_error.utils
The django rendering logic is wrapped to ensure the correct HTML templates are included rendered for each error code.
- django_easy_error.utils.error_render(error_code, request)[source]
Render the appropriate error template for the given error code
- Parameters:
error_code (
int
) – The HTTP error code to render a response forrequest (
HttpRequest
) – The incoming HTTP request
- Return type:
HttpResponse
- Returns:
A rendered HTTP response
django_easy_error.handlers
Request handlers for different error codes.
Handlers are used to process the routing of HTTP errors to the correct template. Handler objects are provided for each of the error views supported by Django.
- django_easy_error.handlers.handler400(request, exception)[source]
Render a response to a 400 error
- Return type:
HttpResponse
- django_easy_error.handlers.handler403(request, exception)[source]
Render a response to a 403 error
- Return type:
HttpResponse