Fix for test configurations without Django loaded