Reference¶
Settings¶
django-auto-webassets provides the following Django settings:
- WEBASSETS_JS_FOLDER
- Standard folder for the javascript files of the views. Default:
js_for_views
- WEBASSETS_PATH_TO_REQUIREJS
- The full relative path to
requirejs.js
relative to one place that Django’s staticfile finder algorithm searches. Default:requirejs/require.js
- WEBASSETS_PATH_TO_REQUIREJS_CFG
- The full relative path to
requirejs.cfg.js
relative to one place that Django’s staticfile finder algorithm searches. Default:requirejs_cfg.js
- WEBASSETS_SCRAMBLE_OUT_JS
- By default, the name of the generated javascript file contains the full
module path of the view. This should not lead to any security risks
because the code of the web application should not be accessible anyhow
to the user. Anyhow, if you want uuid names, set this to true.
Default:
False
. - WEBASSETS_R_JS
- The full relative path to
r.js
relative to one place that Django’s staticfile finder algorithm searches. Default:node_modules/.bin/r.js
- WEBASSETS_OPTIMIZE
- If this is set to true, standard optimizations (minifying etc.) are run
on the resulting javascript file. Default:
True
.
Template Tags¶
django-auto-webassets provides one template tag to include the generated bundle in a template.
- webassets_js
- You should put this tag somewhere in your template where javascript is expected. Please refer to the main documentation.
Mixins¶
Commands¶
- webassetsrequirejs
- Build assets defined by the
django_auto_webassets.views.mixins.AutoWebassetsJSMixin
mixin.