1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-js-asset
7 SDESC[py310]= Django forms.Media script tag (3.10)
8 SDESC[py39]= Django forms.Media script tag (3.9)
9 HOMEPAGE= https://github.com/matthiask/django-js-asset/
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/89/dd/67936526e547dd14ca4e5d13ab1655bc4aefa410f092ad13de3a085a3d51
14 DISTFILE[1]= django_js_asset-2.0.0-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY39 PY310
20 OPTIONS_STANDARD= none
21 VOPTS[py310]= PY39=OFF PY310=ON
22 VOPTS[py39]= PY39=ON PY310=OFF
24 DISTNAME= django_js_asset-2.0.0.dist-info
28 [PY39].RUN_DEPENDS_ON= python-Django:single:py39
29 [PY39].USES_ON= python:py39,wheel
31 [PY310].RUN_DEPENDS_ON= python-Django:single:py310
32 [PY310].USES_ON= python:py310,wheel
34 [FILE:2042:descriptions/desc.single]
35 ===============================================================================
36 django-js-asset -- script tag with additional attributes for
38 ===============================================================================
43 Use this to insert a script tag via ``forms.Media`` containing additional
44 attributes (such as id and ``data-*`` for CSP-compatible data
47 .. code-block:: python
49 from js_asset import JS
58 The rendered media tag (via ``{{ media.js }} or {{ media }}`` will
59 now contain a script tag as follows, without line breaks:
63 <script type="text/javascript" src="/static/asset.js"
64 data-answer="42" id="asset-script"></script>
66 The attributes are automatically escaped. The data attributes may now be
67 accessed inside ``asset.js``:
69 .. code-block:: javascript
71 var answer = document.querySelector("#asset-script").dataset.answer;
73 Also, because the implementation of static differs between supported
74 Django versions (older do not take the presence of
75 ``django.contrib.staticfiles in INSTALLED_APPS`` into account), a
76 ``js_asset.static`` function is provided which does the right thing
79 When adding external script assets, you should pass ``static=False to the
80 JS object to avoid passing the script URL through static()``. In this
81 case, you probably want to add defer or async, and maybe also
82 integrity and crossorigin attributes. Please note that boolean
83 attributes are not properly supported when using Django before 4.1 so
87 .. code-block:: python
90 "https://cdn.example.com/script.js",
98 At the time of writing this app is compatible with Django 1.8 and better
99 (up to and including the Django master branch), but have a look at the
106 86f9f300d682537ddaf0487dc2ab356581b8f50c069bdba91d334a46e449f923 4941 django_js_asset-2.0.0-py3-none-any.whl