BryanWheelock Your solution won't work because your shell is the result of the spawn not a direct interatction with it. What you want to do is this - or at least this is what I do.
Within your workspace (the place where you type python manage.py shell
) create a ipythonrc file. In it put the following:
include ~/.ipython/ipythonrc
execute from django.contrib.auth.models import User
# .
# .
# .
execute import_some module_name model1 model2
For example I also add the following lines in mine..
# Setup Logging
execute import sys
execute import logging
execute loglevel = logging.DEBUG
execute logging.basicConfig(format="%(levelname)-8s %(asctime)s %(name)s %(message)s", datefmt='%m/%d/%y %H:%M:%S', stream=sys.stdout )
execute log = logging.getLogger("")
execute log.setLevel(loglevel)
execute log.debug("Logging has been initialized from ipythonrc")
execute log.debug("Root Logger has been established - use \"log.LEVEL(MSG)\"")
execute log.setLevel(loglevel)
execute log.debug("log.setlevel(logging.DEBUG)")
execute print ""
This allows you to use logging in your modules and keep it DRY. Hope this helps.