I am running django 1.5 on ubuntu 13.04 with apache2 and mod_wsgi locally. Requests that return a 200 status code (no errors) are really fast (~50ms) however if there is an error either in the view etc. or the template, the request takes 2-3 minutes and then shows the traceback as expected.
I tried the test server and got the same results so that suggests the serving of the app isn't at fault. In that case, I assume it's the configuration however since after each change I have to wait 2-3 minutes, I thought I'd ask if anyone has any ideas of the cause or has experienced this before?
It turns out that it was hanging all that time trying to send the error report to MAIL_ADMINS with SMTP however I have DEBUG=True in my settings so it shouldn't be sending error emails... still investigating why that is happening.
The two issues were:
require_debug_false filter was inadvertently missing from the mail_admins logging
should have specified:
As a result, even with DEBUG=True Django would attempt to send an error email to mail_admins however the settings were only configured to work with the SMTP mail server in a staging or production environment so it was hanging trying to connect to the mail server.