From 05eb53603c69b46b70226bfdb2242732b2b169fa Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sun, 12 Dec 2010 23:03:24 +0000 Subject: [PATCH] Fixed #14187 -- Added support for bpython to shell management command. Thanks, Jeremy Dunck. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14896 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/shell.py | 6 +++++- docs/ref/django-admin.txt | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py index f08de4e8928..e4ce462c205 100644 --- a/django/core/management/commands/shell.py +++ b/django/core/management/commands/shell.py @@ -8,7 +8,7 @@ class Command(NoArgsCommand): help='Tells Django to use plain Python, not IPython.'), ) help = "Runs a Python interactive interpreter. Tries to use IPython, if it's available." - shells = ['ipython'] + shells = ['ipython', 'bpython'] requires_model_validation = False def ipython(self): @@ -28,6 +28,10 @@ class Command(NoArgsCommand): # IPython not found at all, raise ImportError raise + def bpython(self): + import bpython + bpython.embed() + def run_shell(self): for shell in self.shells: try: diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 37e12c4cd88..438c599902e 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -747,13 +747,14 @@ shell Starts the Python interactive interpreter. -Django will use IPython_, if it's installed. If you have IPython installed and -want to force use of the "plain" Python interpreter, use the ``--plain`` -option, like so:: +Django will use IPython_ or bpython_ if either is installed. If you have a +rich shell installed but want to force use of the "plain" Python interpreter, +use the ``--plain`` option, like so:: django-admin.py shell --plain .. _IPython: http://ipython.scipy.org/ +.. _bpython: http://bpython-interpreter.org/ sql -------------------------