python-django-rich
Port variant py310
Summary Extensions for using Rich with Django (3.10)
Package version 1.7.0
Homepage https://github.com/adamchainz/django-rich
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v11
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 13 JUL 2023, 17:44:33 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 4.2 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 --------- ``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 You can use ``self.console`` like so: .. code-block:: python from django_rich.management 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`` __ 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 traceback rendering]. .. image:: https://raw.githubusercontent.com/adamchainz/django-rich/main/img/RichRunner.png .. |DiscoverRunner| replace:: DiscoverRunner __ https://docs.djangoproject.com/en/stable/topics/testing/advanced/#defining-a-test-runner
Configuration Switches (platform-specific settings discarded)
PY310 ON Build using Python 3.10 PY311 OFF Build using Python 3.11
Package Dependencies by Type
Build (only) python-pip:single:py310
autoselect-python:single:standard
Build and Runtime python310:single:standard
Runtime (only) python-Django:single:py310
python-rich:single:py310
Download groups
main mirror://PYPIWHL/7e/5f/8965f77f4631c7e969fa6d8540d5771d88f12c24a82b2fd9010fb3334be6
Distribution File Information
085f2776b2318a7bf48fdad337e93c0fa6081a5e660e79c747bac8435c16a910 7081 django_rich-1.7.0-py3-none-any.whl
Ports that require python-django-rich:py310
NetBox:standard Flexible IPAM and DCIM tool with plugin support