Assets can be defined inline in templates:
{% load assets %}
{% assets filter="jsmin", output="gen/packed.js", "common/jquery.js", "site/base.js", "site/widgets.js" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}
Or in your application code:
from django_assets import Bundle, register
js = Bundle('common/jquery.js', 'site/base.js', 'site/widgets.js',
filters='jsmin', output='gen/packed.js')
register('js_all', js)
{% assets "js_all" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}
For more information, see defining your assets.
Your assets are regenerated automatically whenever the source files change. Your done!
If that’s not enough, you can use the managenment command to force a rebuild:
$ ./manage.py assets rebuild
For more information, see building your assets.