Skip to main content
Build Status Coverage Status https://pypip.in/v/django-bower/badge.png https://pypip.in/d/django-bower/badge.png

Easy way to use bower with your Django project.

Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.

Read full documentation on read-the-docs.

Installation

Install django-bower package:

pip install django-bower

Add django-bower to INSTALLED_APPS in your settings:

'djangobower',

Add staticfinder to STATICFILES_FINDERS:

'djangobower.finders.BowerFinder',

Specify path to components root (you need to use an absolute path):

BOWER_COMPONENTS_ROOT = '/PROJECT_ROOT/components/'

If you need, you can manually set the path to bower:

BOWER_PATH = '/usr/bin/bower'

You can see an example settings file in example project.

Usage

Specify BOWER_INSTALLED_APPS in settings, like:

BOWER_INSTALLED_APPS = (
    'jquery#1.9',
    'underscore',
)

Download bower packages with the management command:

./manage.py bower install

Add scripts in the template, like:

{% load static %}
<script type="text/javascript" src='{% static 'jquery/dist/jquery.js' %}'></script>

In production you need to call bower install before collectstatic:

./manage.py bower install
./manage.py collectstatic

If you need to pass arguments to bower, like –allow-root, use:

./manage.py bower install -- --allow-root

You can use bower freeze to receive BOWER_INSTALLED_APPS with fixed current versions:

./manage.py bower freeze

You can call bower commands like info and update with:

./manage.py bower info backbone
./manage.py bower update

Python 3 support

django-bower supports python 3.3+

Metadata

Release files for django-bower 5.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-bower 5.2.0
File Size Uploaded
django-bower-5.2.0.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-bower 5.2.0
File Interpreter ABI Platform
django_bower-5.2.0-py2-none-any.whl Python 2 none any Details

Total release size: 24.6 kB

Release files / django-bower-5.2.0.tar.gz

Download URL django-bower-5.2.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3ab5699b782d63d1aa8e5d61f9bdcdb8d29137e7ba6f19d094d566241afee0f2
BLAKE2b-256 checksum
How to use checksums
691e928af71407ebbec908827e83004b079bf59a47e7d7fd7e0adf3931cba2a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_bower-5.2.0-py2-none-any.whl

Download URL django_bower-5.2.0-py2-none-any.whl
Size 16.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
f1cf649842c0cb28f8aa28617e99fc7fb7773bac4e8886ee4e36962a38c99a6e
BLAKE2b-256 checksum
How to use checksums
e6bcf6869ec6c1b64cbed37d06d65306bdbdb4692f3cba8c23251b253887df9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

5.2.0 This release

2 release files

5.1.0

2 release files

5.0.4

1 release file

5.0.3

1 release file

5.0.2

1 release file

5.0.1

1 release file

5.0

1 release file

4.8.1

1 release file

4.8

1 release file

4.7

1 release file

4.6

1 release file

4.5

1 release file

4.4

1 release file

4.3

1 release file

4.2

1 release file

4

1 release file

3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page