# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-django-rich VERSION= 1.9.0 KEYWORDS= python VARIANTS= v11 v12 SDESC[v11]= Extensions for using Rich with Django (3.11) SDESC[v12]= Extensions for using Rich with Django (3.12) HOMEPAGE= none CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/92/24/f3014be14c0c6deaf5c0ec53d003fb0e07890780d48ee4ba5765421882b0 DISTFILE[1]= django_rich-1.9.0-py3-none-any.whl:main DF_INDEX= 1 SPKGS[v11]= single SPKGS[v12]= single OPTIONS_AVAILABLE= PY311 PY312 OPTIONS_STANDARD= none VOPTS[v11]= PY311=ON PY312=OFF VOPTS[v12]= PY311=OFF PY312=ON DISTNAME= django_rich-1.9.0.dist-info GENERATED= yes [PY311].RUN_DEPENDS_ON= python-Django:single:v11 python-rich:single:v11 [PY311].USES_ON= python:v11,wheel [PY312].RUN_DEPENDS_ON= python-Django:single:v12 python-rich:single:v12 [PY312].USES_ON= python:v12,wheel [FILE:2626: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.8 to 3.12 supported. Django 3.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 --------- ``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|__. For example, to disable the default-on markup and highlighting flags: .. |functools.partial| replace:: ``functools.partial`` __ https://docs.python.org/3/library/functools.html#functools.partial .. code-block:: python from functools import partial from django_rich.management import RichCommand from rich.console import Console class Command(RichCommand): make_rich_console = partial(Console, markup=False, highlight=False) def handle(self, *args, **options): ... ``django_rich.test.RichRunner`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A subclass of Django's |DiscoverRunner|__ with colourized outputs and [nice [FILE:113:distinfo] 9d8e7d61e04ab51bd7d03491a2562767eb989a14d043d6c6afe6adfd8d8aafe8 7172 django_rich-1.9.0-py3-none-any.whl