Port variant v11
Summary Extensions for using Rich with Django (3.11)
Package version 1.8.0
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v12
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 12 OCT 2023, 22:54:29 UTC
Port created 01 JAN 2023, 17:21:46 UTC
Subpackage Descriptions
single =========== django-rich =========== :alt: pre-commit Extensions for using [Rich] with Django. Requirements ------------ Python 3.8 to 3.12 supported. Django 3.2 to 5.0 supported. ---- **Want to work smarter and faster?** Check out my book [Boost Your Django DX] which covers many ways to improve your development experience. I wrote django-rich whilst working on the book! ---- 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 --------- ```` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 __ .. |Console| replace:: Console __ You can use ``self.console`` like so: .. code-block:: python from import RichCommand class Command(RichCommand): def handle(self, *args, **options): self.console.print("[bold red]Alert![/bold red]") 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`` __ .. code-block:: python from functools import partial from 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 traceback rendering]. .. image:: .. |DiscoverRunner| replace:: DiscoverRunner __
Configuration Switches (platform-specific settings discarded)
PY311 ON Build using Python 3.11 PY312 OFF Build using Python 3.12
Package Dependencies by Type
Build (only) python-pip:single:v11
Build and Runtime python311:single:standard
Runtime (only) python-Django:single:v11
Download groups
main mirror://PYPIWHL/45/e4/1066e09a562333f587598ae20e5991beb07751ed94f350c8aae21a476b67
Distribution File Information
3016daddfa68428e633b9fd0f26245c7ab88a301bb6373d0423f5c328ec36673 7082 django_rich-1.8.0-py3-none-any.whl
Ports that require python-django-rich:v11
No other ports depend on this one.