diff --git i/django/core/management/commands/shell.py w/django/core/management/commands/shell.py
index d8bded0..e52af95 100644
i
|
w
|
from django.core.management.base import BaseCommand
|
4 | 4 | |
5 | 5 | |
6 | 6 | class Command(BaseCommand): |
7 | | help = "Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available." |
| 7 | help = "Runs a Python interactive interpreter. Tries to use IPython, bpython or ptpython, if one of them is available." |
8 | 8 | requires_system_checks = False |
9 | | shells = ['ipython', 'bpython'] |
| 9 | shells = ['ipython', 'bpython', 'ptpython'] |
10 | 10 | |
11 | 11 | def add_arguments(self, parser): |
12 | 12 | parser.add_argument('--plain', action='store_true', dest='plain', |
13 | | help='Tells Django to use plain Python, not IPython or bpython.') |
| 13 | help='Tells Django to use plain Python, not IPython, bpython or ptpython.') |
14 | 14 | parser.add_argument('--no-startup', action='store_true', dest='no_startup', |
15 | 15 | help='When using plain Python, ignore the PYTHONSTARTUP environment variable and ~/.pythonrc.py script.') |
16 | 16 | parser.add_argument('-i', '--interface', choices=self.shells, dest='interface', |
… |
… |
class Command(BaseCommand):
|
50 | 50 | import bpython |
51 | 51 | bpython.embed() |
52 | 52 | |
| 53 | def ptpython(self): |
| 54 | from ptpython.repl import embed |
| 55 | embed(globals(), locals()) |
| 56 | |
53 | 57 | def run_shell(self, shell=None): |
54 | 58 | available_shells = [shell] if shell else self.shells |
55 | 59 | |