I'm developing my own template for errors pages, but the handler500 don't get the exception parameter, and I can't know what is the cause of error.
How can I do this? My custom template already is working, but I need the information about the exception cause. My handler500:
def error_500(request):
template_name = "error_500.html"
error_code = "500"
url = request.build_absolute_uri()
username = request.user.username
useruuid = request.user.uuid
date = datetime.datetime.now()
errorObject = Errors(
error_code=error_code, url=url,
username=username, useruuid=useruuid,
date=date
)
errorObject.save()
errorUUID = errorObject.uuid
context = {
"errorUUID": errorUUID
}
return render(request, template_name, context)