process_exception is only triggered when an Exception view appears . As the comment says
If the view throws an exception, run it through the exception middleware,
and if the exception middleware returns a response, use this.
Otherwise, re-raise the exception.
Exceptions caused by incorrect configuration, import error, process_request and process_view cannot be detected and handled by process_exception handlers.
To check if your process_exception working, raise an Exception in the view after you make sure that it works well.
There is no direct relationship between process_request and process_exception ; they are handlers for different purposes and are called at different stages. Any exception was thrown after the process_request , successfully executed and before the submission, was not caught and processed by the process_exception as said.
source share