Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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