I am trying to add a new middle ware into my Django application. However, my app now stalls when being visited. Eventually, after a long time, a 500 error surfaces.
Is there an error log anywhere on the server for Django? I want to see what the error was.
In general, logging will depend on how you are serving django (modwsgi, gunicorn, passenger, etc…), how you have configured django logging and where the error occurs, i.e. if the error happens before/after django is handling the request.
If you have configured your mail host and logging, django can send you the error messages. If the error occurs and django isn’t handling it, it will generally show in your server’s logs.
Personally, I think one of the best ways to view django errors is using raven with sentry, either self hosted or on getsentry. It even comes with a wsgi middleware to catch errors on the wsgi layer.