Skip to content

Instantly share code, notes, and snippets.

@lprsd
Created November 11, 2009 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lprsd/231878 to your computer and use it in GitHub Desktop.
Save lprsd/231878 to your computer and use it in GitHub Desktop.
bpython equivallent of shell_plus
try:
from django.core.management import setup_environ
import settings
setup_environ(settings)
print 'imported django settings'
try:
exec_strs = ["from %s.models import *"%apps for apps in settings.INSTALLED_APPS ]
for x in exec_strs:
try:
exec(x)
except:
print 'Not imported for %s' %x
print 'imported django models'
except:
pass
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment