skillfed

django-rich

Extensions for using Rich with Django.

django-rich v2.2.0 226.9K downloads/30d#9,191 on PyPI154
Permissive license MIT Active released

What it is and what it does

django-rich bridges Rich, a terminal formatting library, with Django's built-in development tools. It provides three main extensions: an enhanced shell command that enables Rich's pretty-printing and auto-imports key Rich functions (on Django 5.2+), a RichCommand base class for custom management commands that adds a Rich Console to your command's output, and a RichRunner test class that replaces Django's default test runner with colorized output and Rich's traceback rendering.

The package is designed to improve developer experience during local development and testing. It requires minimal setup—just add it to INSTALLED_APPS for shell integration, or point TEST_RUNNER to the RichRunner class. All features respect Django's color control flags (--no-color, --force-color), and the test runner's output width can be tuned via the COLUMNS environment variable for CI systems.

Use it for:

  • Run Django shell with automatic Rich pretty-printing and inspect/print/pprint functions available without manual import.
  • Write custom management commands with colorized, formatted console output using self.console from RichCommand.
  • Run tests with colorized output and Rich's traceback rendering to see source code and local values per frame.
  • Debug test failures in CI by setting COLUMNS environment variable to control Rich's terminal width detection.
  • Combine RichRunner with other test runner classes for customized test output while keeping Rich's formatting.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates Rich's terminal formatting and pretty-printing into Django's shell command, management commands, and test runner for colorized, readable output.

Yes. django-rich is production-stable, actively maintained, has no known vulnerabilities, and adds meaningful developer experience improvements with minimal friction. Install it if you use Django's shell, write management commands, or want better test output readability—the setup is trivial and the benefits are immediate.

Install

django-rich on PyPI

pip

pip install django-rich

uv

uv add django-rich

poetry

poetry add django-rich

Installing django-rich

Before you install

Low install friction with only two runtime dependencies (django and rich). Actively maintained with recent releases; last commit on 2026-08-13 and production-stable status. No known vulnerabilities.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.

Quickstart

pip install django-rich

# In settings.py, add to INSTALLED_APPS:
INSTALLED_APPS = [
    ...,
    "django_rich",
]

# Or subclass RichCommand for custom management commands:
from django_rich.management import RichCommand

class Command(RichCommand):
    def handle(self, *args, **options):
        self.console.print("[bold]Hello[/bold]")

Requires Django 4.2 to 6.0 and Python 3.9 to 3.14; features like automatic Rich imports in shell only activate on Django 5.2+.

Verify before relying

  • Whether the shell command integration works with IPython or only the standard Python REPL
  • Performance impact of colorization on large test suites or CI environments

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — django, rich
Maintenance actively maintained — 330 days since the last release
Last repo commit
First released
Downloads 226,927/month — #9,191 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_rich-2.2.0-py3-none-any.whl

Keywords: Django

Development Status :: 5 - Production/StableFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTyping :: Typed

Tags

django shell rich formattingdjango management command colorsdjango test runner pretty outputrich terminal integration djangodjango repl pretty printingcolorized django test outputdjango console formatting
django-extensionterminal-uideveloper-tools

More Application Frameworks packages