help='Tells Django to use plain Python, not IPython.'),
help = "Runs a Python interactive interpreter. Tries to use IPython, if it's available."
+ requires_model_validation = False
- requires_model_validation = False
+ from IPython.frontend.terminal.embed import TerminalInteractiveShell
+ shell = TerminalInteractiveShell()
+ # Explicitly pass an empty list as arguments, because otherwise
+ # IPython would use sys.argv from this script.
+ from IPython.Shell import IPShell
+ shell = IPShell(argv=)
+ # IPython not found at all, raise ImportError
+ for shell in self.shells:
+ return getattr(self, shell)()
def handle_noargs(self, **options):
# XXX: (Temporary) workaround for ticket #1796: force early loading of all
# Don't bother loading IPython, because the user wants plain Python.
- # Explicitly pass an empty list as arguments, because otherwise IPython
- # would use sys.argv from this script.
- shell = IPython.Shell.IPShell(argv=)
# Set up a dictionary to serve as the environment for the shell, so