Permalink
Browse files

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.
  • Loading branch information...
ramiro committed Dec 31, 2012
1 parent 9180146 commit 3570ff734e93f493e023b912c9a97101f605f7f5
Showing with 4 additions and 2 deletions.
  1. +4 −2 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

3 comments on commit 3570ff7

@skroth

This comment has been minimized.

Show comment
Hide comment
@skroth

skroth Jun 19, 2013

Thank you for this!

Thank you for this!

@Matt-Deacalion

This comment has been minimized.

Show comment
Hide comment
@Matt-Deacalion

Matt-Deacalion Jun 20, 2013

Contributor

Brilliant, thanks! 😄

Contributor

Matt-Deacalion replied Jun 20, 2013

Brilliant, thanks! 😄

@fetzig

This comment has been minimized.

Show comment
Hide comment
@fetzig

fetzig Oct 14, 2014

Contributor

👍

Contributor

fetzig replied Oct 14, 2014

👍

Please sign in to comment.