/django-simple-bower

Integrate bower with django using a template tag

Primary LanguagePythonDo What The F*ck You Want To Public LicenseWTFPL

##Installation

Install bower from npm:

$ npm install -g bower

Install django-simple-bower with pip

$ pip install django-simple-bower

Add django-simple-bower to INSTALLED_APPS in your settings:

'simplebower',

Usage

Set path to bower components (use absolute path):

BOWER_COMPONENTS_ROOT = '/PROJECT_ROOT/static/components'

Set url to bower

BOWER_COMPONENTS_URL = '/static/components'

Load bower in your template

{% load bower %}

Finally call bower components

{% bower 'css' bootstrap %}

{% bower 'js' jquery %}
{% bower 'js' bootstrap %}

HTML Output

<link rel="stylesheet" href="/static/components/bootstrap/dist/css/bootstrap.css">

<script src="/static/components/jquery/dist/jquery.js"></script>
<script src="/static/components/bootstrap/dist/js/bootstrap.js"></script>

WTFPL