Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add ptpython support to Django's shell command
from import Command as ShellCommand
class Command(ShellCommand):
shells = ['ptpython', 'ipython', 'bpython']
def ptpython(self):
from prompt_toolkit.contrib.repl import embed
embed(globals(), locals(), vi_mode=False, history_filename=None)

This comment has been minimized.

Copy link
Owner Author

commented Sep 30, 2014

Simply add this to one of your project's apps.


This comment has been minimized.

Copy link

commented Oct 13, 2017

Alternatively, you can do this:

  1. django_admin$ pip install django-extensions

  2. Append django_extensions (note the underscore this time) to the INSTALLED_APPS variable in (or whatever python file you use for Django settings).

  3. Finally: django_admin$ python ./ shell_plus [--settings]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.