8000 Fixed #17078 -- Made shell use std IPython startup. · django/django@3570ff7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3570ff7

Browse files
committed
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.
1 parent 9180146 commit 3570ff7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

django/core/management/commands/shell.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ class Command(NoArgsCommand):
1919

2020
def ipython(self):
2121
try:
22-
from IPython import embed
23-
embed()
22+
from IPython.frontend.terminal.ipapp import TerminalIPythonApp
23+
app = TerminalIPythonApp.instance()
24+
app.initialize(argv=[])
25+
app.start()
2426
except ImportError:
2527
# IPython < 0.11
2628
# Explicitly pass an empty list as arguments, because otherwise

0 commit comments

Comments
 (0)
0