From 3570ff734e93f493e023b912c9a97101f605f7f5 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Mon, 31 Dec 2012 19:40:02 -0300 Subject: [PATCH] Fixed #17078 -- Made shell use std IPython startup. This allows for a behavior more in line with what is expected by Ipython users, e.g. the user namespace is initialized from config files, startup files. Thanks Benjamin Ragan-Kelley from the IPython dev team for the patch. --- django/core/management/commands/shell.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py index 52a8cab7e4..f883fb95d8 100644 --- a/django/core/management/commands/shell.py +++ b/django/core/management/commands/shell.py @@ -19,8 +19,10 @@ class Command(NoArgsCommand): def ipython(self): try: - from IPython import embed - embed() + from IPython.frontend.terminal.ipapp import TerminalIPythonApp + app = TerminalIPythonApp.instance() + app.initialize(argv=[]) + app.start() except ImportError: # IPython < 0.11 # Explicitly pass an empty list as arguments, because otherwise