I had a problem in production where one apache Django process was spitting out ViewDoesNotExist errors due to an Exception that occurred when loading the relevant view module. The Exception was due to an incredibly improbable event that occurred deep in the import chain.
When the error occurred, this process just kept serving ViewDoesNotExist errors, as the view had failed to import.
What I would rather have happen to handle unforeseen future bugs is for the process to just crash on an import error. Had the process restarted, at most one request would have ever raised this error.
Is there a way to change this behavior? (without modifying the django source)
I don’t believe so. Django itself is designed to be a framework with a testing server (and as a server, it isn’t supposed to crash unless in extreme circumstances). According to OP, the problem is with a race condition in Django’s bootstrapping. I have found the answer (as solved by someone else) here