components
each project, pull the bower install
with your hands. After pip
with requirements.txt
to do it even somehow laziness.settings
and transparent work with staticfiles
.django-bower
from django-bower
: pip install django-bower
INSTALLED_APPS
in settings
: 'djangobower',
STATICFILES_FINDERS
: 'djangobower.finders.BowerFinder',
components
- the place where the installed packages are stored. The path must be absolute and exist: BOWER_COMPONENTS_ROOT = '/PROJECT_ROOT/components/'
BOWER_INSTALLED_APPS
in settings
, for example: BOWER_INSTALLED_APPS = ( 'jquery#2', 'underscore', )
bower_install
team, you can later use it to update packages: ./manage.py bower_install
{% load static %} <script type="text/javascript" src='{% static 'jquery/jquery.js' %}'></script>
bower_install
needs to be done before collectstatic
: ./manage.py bower_install ./manage.py collectstatic
BOWER_INSTALLED_APPS
with fixed package versions, use bower_freeze
: ./manage.py bower_freeze
Source: https://habr.com/ru/post/183094/
All Articles