Skip to content

Instantly share code, notes, and snippets.

@itmustbejj
Created September 15, 2011 18:08
Show Gist options
  • Save itmustbejj/1220002 to your computer and use it in GitHub Desktop.
Save itmustbejj/1220002 to your computer and use it in GitHub Desktop.
def load_django_models():
try:
from django.db.models.loading import get_models
for m in get_models():
ip.ex("from %s import %s" % (m.__module__, m.__name__))
except ImportError:
print "INFO: could not find a django env"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment