Skip to content

Commit

Permalink
Fixed #17078 -- Made shell use std IPython startup.
Browse files Browse the repository at this point in the history
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 3570ff7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django/core/management/commands/shell.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ class Command(NoArgsCommand):


def ipython(self): def ipython(self):
try: try:
from IPython import embed from IPython.frontend.terminal.ipapp import TerminalIPythonApp
embed() app = TerminalIPythonApp.instance()
app.initialize(argv=[])
app.start()
except ImportError: except ImportError:
# IPython < 0.11 # IPython < 0.11
# Explicitly pass an empty list as arguments, because otherwise # Explicitly pass an empty list as arguments, because otherwise
Expand Down

3 comments on commit 3570ff7

@skroth
Copy link

@skroth skroth commented on 3570ff7 Jun 19, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

@Matt-Deacalion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant, thanks! 😄

@fetzig
Copy link
Contributor

@fetzig fetzig commented on 3570ff7 Oct 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.