1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-rich
7 SDESC[v11]= Extensions for using Rich with Django (3.11)
8 SDESC[v12]= Extensions for using Rich with Django (3.12)
9 HOMEPAGE= https://github.com/adamchainz/django-rich
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/45/e4/1066e09a562333f587598ae20e5991beb07751ed94f350c8aae21a476b67
14 DISTFILE[1]= django_rich-1.8.0-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY311 PY312
20 OPTIONS_STANDARD= none
21 VOPTS[v11]= PY311=ON PY312=OFF
22 VOPTS[v12]= PY311=OFF PY312=ON
24 DISTNAME= django_rich-1.8.0.dist-info
28 [PY311].RUN_DEPENDS_ON= python-Django:single:v11
29 python-rich:single:v11
30 [PY311].USES_ON= python:v11,wheel
32 [PY312].RUN_DEPENDS_ON= python-Django:single:v12
33 python-rich:single:v12
34 [PY312].USES_ON= python:v12,wheel
36 [FILE:2587:descriptions/desc.single]
43 Extensions for using [Rich] with Django.
48 Python 3.8 to 3.12 supported.
50 Django 3.2 to 5.0 supported.
54 **Want to work smarter and faster?**
55 Check out my book [Boost Your Django DX] which covers many ways to improve
56 your development experience.
57 I wrote django-rich whilst working on the book!
64 1. Install with **pip**:
68 python -m pip install django-rich
70 None of django-rich’s features are activated by default.
71 Follow the documentation below to use them.
76 ``django_rich.management.RichCommand``
77 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79 A subclass of Django’s |BaseCommand|__ class that sets its
80 ``self.console`` to a Rich |Console|__.
81 The Console uses the command’s stdout argument, which defaults to
83 Colourization is enabled or disabled according to Django’s ``--no-color
84 and --force-color`` flags.
86 .. |BaseCommand| replace:: BaseCommand
88 https://docs.djangoproject.com/en/stable/howto/custom-management-commands/#django.core.management.BaseCommand
90 .. |Console| replace:: Console
91 __ https://rich.readthedocs.io/en/stable/console.html
93 You can use ``self.console`` like so:
95 .. code-block:: python
97 from django_rich.management import RichCommand
99 class Command(RichCommand):
100 def handle(self, *args, **options):
101 self.console.print("[bold red]Alert![/bold red]")
103 You can customize the construction of the Console by overriding the
104 make_rich_console class attribute.
105 This should be a callable that returns a Console, such as a
106 |functools.partial|__.
107 For example, to disable the default-on markup and highlighting flags:
109 .. |functools.partial| replace:: ``functools.partial``
110 __ https://docs.python.org/3/library/functools.html#functools.partial
112 .. code-block:: python
114 from functools import partial
116 from django_rich.management import RichCommand
117 from rich.console import Console
119 class Command(RichCommand):
120 make_rich_console = partial(Console, markup=False, highlight=False)
122 def handle(self, *args, **options):
125 ``django_rich.test.RichRunner``
126 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128 A subclass of Django's |DiscoverRunner|__ with colourized outputs and [nice
129 traceback rendering].
132 https://raw.githubusercontent.com/adamchainz/django-rich/main/img/RichRunner.png
134 .. |DiscoverRunner| replace:: DiscoverRunner
136 https://docs.djangoproject.com/en/stable/topics/testing/advanced/#defining-a-test-runner
140 3016daddfa68428e633b9fd0f26245c7ab88a301bb6373d0423f5c328ec36673 7082 django_rich-1.8.0-py3-none-any.whl