Created
November 6, 2013 05:30
-
-
Save amitu/7331401 to your computer and use it in GitHub Desktop.
Find out why is something getting imported, as import fails in django sometimes leads to unhelpful "ImproperlyConfigured" exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, traceback | |
class ImportBlocker(object): | |
def find_module(self, fullname, path=None): | |
if "mobil" in fullname and "mobile" not in fullname: | |
print fullname | |
print traceback.print_stack() | |
raise Exception() | |
sys.meta_path = [ImportBlocker()] | |
# ... rest of manage.py ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment