# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-django-rich VERSION= 1.13.0 KEYWORDS= python VARIANTS= v12 v13 SDESC[v12]= Extensions for using Rich with Django (3.12) SDESC[v13]= Extensions for using Rich with Django (3.13) HOMEPAGE= none CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/6a/67/a81ebabc4c609045d884fc997087023c66a6b384d43bc0f039d17bc47fc3 DISTFILE[1]= django_rich-1.13.0-py3-none-any.whl:main DF_INDEX= 1 SPKGS[v12]= single SPKGS[v13]= single OPTIONS_AVAILABLE= PY312 PY313 OPTIONS_STANDARD= none VOPTS[v12]= PY312=ON PY313=OFF VOPTS[v13]= PY312=OFF PY313=ON DISTNAME= django_rich-1.13.0.dist-info GENERATED= yes [PY312].RUN_DEPENDS_ON= python-Django:single:v12 python-rich:single:v12 [PY312].USES_ON= python:v12,wheel [PY313].RUN_DEPENDS_ON= python-Django:single:v13 python-rich:single:v13 [PY313].USES_ON= python:v13,wheel [FILE:2675:descriptions/desc.single] =========== django-rich =========== :alt: pre-commit Extensions for using [Rich] with Django. ---- **Work smarter and faster** with my book [Boost Your Django DX] which covers many ways to improve your development experience. I wrote django-rich whilst working on the book! ---- Requirements ------------ Python 3.9 to 3.13 supported. Django 4.2 to 5.1 supported. Installation ------------ 1. Install with **pip**: .. code-block:: sh python -m pip install django-rich None of django-rich’s features are activated by default. Follow the documentation below to use them. Reference --------- shell command integration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ django-rich has an extended version of Django’s built-in |shell command|__ that enables `Rich’s pretty-printing `__. To activate this feature, add django_rich to your INSTALLED_APPS setting: .. |shell command| replace:: shell command __ https://docs.djangoproject.com/en/stable/ref/django-admin/#shell .. code-block:: python INSTALLED_APPS = [ ..., "django_rich", ..., ] This feature only affects the Python and bypthon interpreters, not IPython. For IPython support, see [the Rich documentation]. ``django_rich.management.RichCommand`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A subclass of Django’s |BaseCommand|__ class that sets its ``self.console`` to a Rich |Console|__. The Console uses the command’s stdout argument, which defaults to ``sys.stdout``. Colourization is enabled or disabled according to Django’s ``--no-color and --force-color`` flags. .. |BaseCommand| replace:: BaseCommand __ https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand .. |Console| replace:: Console __ https://rich.readthedocs.io/en/stable/console.html Use the features of ``self.console`` as you like: .. code-block:: python from time import sleep from django_rich.management import RichCommand class Command(RichCommand): def handle(self, *args, **options): self.console.print("[bold blue]Frobnicating widgets:[/bold blue]") with self.console.status("Starting...") as status: for i in range(1, 11): status.update(f"Widget {i}...") sleep(1) self.console.log(f"Widget {i} frobnicated.") You can customize the construction of the Console by overriding the make_rich_console class attribute. This should be a callable that returns a Console, such as a |functools.partial|__. [FILE:114:distinfo] 9146dc0e0134bb970f156e8ba3015abd8982c35418fbab45004c561b521ee509 8855 django_rich-1.13.0-py3-none-any.whl