GithubHelp home page GithubHelp logo

graingert / django-bower Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nvbn/django-bower

0.0 3.0 0.0 84 KB

Easy way to use bower with your django project

Home Page: https://django-bower.readthedocs.org/

Python 100.00%

django-bower's Introduction

Django-bower

Build Status Coverage Status https://pypip.in/v/django-bower/badge.png https://pypip.in/d/django-bower/badge.png https://goo.gl/Cp4t39

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',

Specifie path to components root (you need to use absolute path):

BOWER_COMPONENTS_ROOT = '/PROJECT_ROOT/components/'

If you need, you can manually set path to bower

BOWER_PATH = '/usr/bin/bower'

You can see example settings file in example project.

Usage

Specifie BOWER_INSTALLED_APPS in settings, like:

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

Download bower packages with management command:

./manage.py bower_install

Add scripts in template, like:

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

In production you need to call bower_install before collectstatic:

./manage.py bower_install
./manage.py collectstatic

You can use bower_freeze to receive BOWER_INSTALLED_APPS with fixed current versions:

./manage.py bower_freeze

Python 3 support

django-bower support python 3.3+

django-bower's People

Contributors

nvbn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.