python-django-js-asset
Port variant v15
Summary Django forms.Media script tag (3.15)
Package version 5.0.0
Homepage https://github.com/feincms/django-js-asset/
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v14
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 13 NOV 2026, 13:25:52 UTC
Port created 02 FEB 2018, 15:29:04 UTC
Subpackage Descriptions
single ============================================================================= django-js-asset -- Script, Stylesheet and JSON support for django.forms.Media ============================================================================= django-js-asset brings Django's object-based media assets to every supported Django version and adds what Django doesn't have yet: * [Script and Stylesheet ] are Django's own classes where Django has them (Script arrived in 5.2, Stylesheet in 6.1) and backports otherwise. * InlineStyle and JSON render `` Import Script and Stylesheet from ``django.forms`` once your project only supports Django versions which have them. Use ``**{...}`` for attributes which aren't valid Python identifiers, such as ``data-*`` attributes, which are a CSP-compatible way to pass data to a script (``document.querySelector("#data-script").dataset.answer``). Attributes are escaped. All assets can go into ``js=[...]``, which is a simple list, while css needs a dictionary keyed by medium. A stylesheet in js is only de-duplicated against that list though, ``forms.Media keeps css`` in a separate slot. Inline CSS is rendered verbatim -- a ``