HOLIDAY SALE! Save 50% on Membership with code HOLIDAY50. Save 15% on Mentorship with code HOLIDAY15.

9) Work With Databases, Models, and the Django Admin Lesson

Install bpython

3 min to complete · By Martin Breuss

To install the augmented Python REPL experience with bpython, you need to install it in your environment. To do so, make sure your virtual environment is activated, then use your package manager to install:

$ pip install bpython

What Does bpython Do?

Following that, your Python and Django shells should now be adorned with a couple of helpful enhancements, such as:

  • In-line syntax highlighting
  • Readline-like autocomplete with suggestions displayed as you type.
  • Expected parameter list for any Python function.
  • Save the code you've entered to a file.
  • Auto-indentation.

... and more. Check out their official website to learn more.

Colorful illustration of a light bulb

Info: Installing bpython is completely optional and not part of the Django polls tutorial. It's just a convenient tool that makes interacting with your Django shell easier and more colorful :)

Summary: Install bpython

  • Install bpython in your virtual environment with the following command: pip install bpython
  • bpython augments your shells with syntax highlighting, autocomplete, parameter list, saving code, and auto-indentation