Skip to content

Instantly share code, notes, and snippets.

@lprsd
Created November 11, 2009 11:32
Show Gist options
  • 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