1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-django-js-asset
7 SDESC[py37]= Django forms.Media script tag (PY37)
8 SDESC[py38]= Django forms.Media script tag (PY38)
9 HOMEPAGE= https://github.com/matthiask/django-js-asset/
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/aa/2d/98089cf51c8e83bc70723021390b94a3638a4a0ce30a47e2e70476b2095d
14 DISTFILE[1]= django_js_asset-1.2.2-py2.py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY38 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py37]= PY38=OFF PY37=ON
22 VOPTS[py38]= PY38=ON PY37=OFF
24 DISTNAME= django_js_asset-1.2.2.dist-info
28 [PY37].BUILD_DEPENDS_ON= python-pip:single:py37
29 [PY37].USES_ON= python:py37,wheel
31 [PY38].BUILD_DEPENDS_ON= python-pip:single:py38
32 [PY38].USES_ON= python:py38,wheel
34 [FILE:1988: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
80 the JS object to avoid passing the script URL through static()``.
81 In this case, you probably want to add defer or async, and maybe
82 also integrity and crossorigin attributes. Please note that
83 boolean attributes are not properly supported, so specify them as
87 "https://cdn.example.com/script.js",
95 At the time of writing this app is compatible with Django 1.7 and better
96 (up to and including the Django master branch), but have a look at the
102 8ec12017f26eec524cab436c64ae73033368a372970af4cf42d9354fcb166bdd 5775 django_js_asset-1.2.2-py2.py3-none-any.whl