﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25536	Add support for ptpython shell	Matheus Rosa	Matheus Rosa	"I would like to add support for the `ptpython` shell. `ptpython` is very powerful, lightweight shell for Python. https://github.com/jonathanslenders/ptpython.

The implementation is very simple. I've already done this in my local clone of django in a local branch based from master. Here is the diff:

{{{#!bash
diff --git i/django/core/management/commands/shell.py w/django/core/management/commands/shell.py
index d8bded0..e52af95 100644
--- i/django/core/management/commands/shell.py
+++ w/django/core/management/commands/shell.py
@@ -4,13 +4,13 @@ from django.core.management.base import BaseCommand


 class Command(BaseCommand):
-    help = ""Runs a Python interactive interpreter. Tries to use IPython or bpython, if one of them is available.""
+    help = ""Runs a Python interactive interpreter. Tries to use IPython, bpython or ptpython, if one of them is available.""
     requires_system_checks = False
-    shells = ['ipython', 'bpython']
+    shells = ['ipython', 'bpython', 'ptpython']

     def add_arguments(self, parser):
         parser.add_argument('--plain', action='store_true', dest='plain',
-            help='Tells Django to use plain Python, not IPython or bpython.')
+            help='Tells Django to use plain Python, not IPython, bpython or ptpython.')
         parser.add_argument('--no-startup', action='store_true', dest='no_startup',
             help='When using plain Python, ignore the PYTHONSTARTUP environment variable and ~/.pythonrc.py script.')
         parser.add_argument('-i', '--interface', choices=self.shells, dest='interface',
@@ -50,6 +50,10 @@ class Command(BaseCommand):
         import bpython
         bpython.embed()

+    def ptpython(self):
+        from ptpython.repl import embed
+        embed(globals(), locals())
+
     def run_shell(self, shell=None):
         available_shells = [shell] if shell else self.shells
}}}

I don't think tests are needed since I didn't find tests for the `ipython` and `bpython` shells."	New feature	closed	Core (Management commands)	1.8	Normal	wontfix	python shell	matheusdsrosa@…	Unreviewed	1	0	0	0	0	0
