Compiles and bundles static assets. Uses a directive processor similiar to Ruby's Sprockets
Project description
=============
Static Assets
=============
django-staticassets is a django app to compile and bundle static assets, it
works together with django's contrib staticfiles app. Heavly inspired by ruby's
`Sprockets <https://github.com/sstephenson/sprockets>`_. it has the same directive processor to declare dependencies
directly in asset source files.
Changelog
=========
0.1
---
initial version
Requirements
============
* Python 2.6+
* Django 1.4+
Instructions
============
to install and use django-static assets just download it using pip and add it to the installed apps on your project settings file::
$ pip install django-staticassets
if your gonna use Sass or Less files you'll also need the sass and less compiler on your path
then You will need to include ``staticassets`` in your ``INSTALLED_APPS``::
INSTALLED_APPS = (
...
'staticassets',
)
if ``staticassets`` is not the last app in the list, and you have more applications overriding ``runserver`` command, you will also need to add ``staticassets`` static files handler view in the urls.py::
from django.conf.urls.static import static
if settings.DEBUG and settings.STATIC_URL:
urlpatterns += static(settings.STATIC_URL, view='staticassets.views.serve')
Then in the templates file, load the staticassets and link your manifests (no need to specify the file extension), the path is appended to the STATIC_ROOT location::
{% load staticassets %}
{% block stylesheets %}
{% stylesheet "css/application" %}
<link rel="stylesheet" href="{{ asset.url }}"/>
{% endstylesheet %}
{% endblock %}
{% block javascripts %}
{% javascript "js/application" %}
<script src="{{ asset.url }}"></script>
{% endjavascript %}
{% endblock %}
Manifests files
============
``staticassets`` uses the same directives syntax and preprocessing as `Sprockets <http://guides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives>`_
just put your manifest files in the
Example
-------
stylesheets::
*= require application/styles/fonts/lato
*= require application/styles/fonts/awesome
scripts::
//= require foundation/jquery
//= require foundation
Static Assets
=============
django-staticassets is a django app to compile and bundle static assets, it
works together with django's contrib staticfiles app. Heavly inspired by ruby's
`Sprockets <https://github.com/sstephenson/sprockets>`_. it has the same directive processor to declare dependencies
directly in asset source files.
Changelog
=========
0.1
---
initial version
Requirements
============
* Python 2.6+
* Django 1.4+
Instructions
============
to install and use django-static assets just download it using pip and add it to the installed apps on your project settings file::
$ pip install django-staticassets
if your gonna use Sass or Less files you'll also need the sass and less compiler on your path
then You will need to include ``staticassets`` in your ``INSTALLED_APPS``::
INSTALLED_APPS = (
...
'staticassets',
)
if ``staticassets`` is not the last app in the list, and you have more applications overriding ``runserver`` command, you will also need to add ``staticassets`` static files handler view in the urls.py::
from django.conf.urls.static import static
if settings.DEBUG and settings.STATIC_URL:
urlpatterns += static(settings.STATIC_URL, view='staticassets.views.serve')
Then in the templates file, load the staticassets and link your manifests (no need to specify the file extension), the path is appended to the STATIC_ROOT location::
{% load staticassets %}
{% block stylesheets %}
{% stylesheet "css/application" %}
<link rel="stylesheet" href="{{ asset.url }}"/>
{% endstylesheet %}
{% endblock %}
{% block javascripts %}
{% javascript "js/application" %}
<script src="{{ asset.url }}"></script>
{% endjavascript %}
{% endblock %}
Manifests files
============
``staticassets`` uses the same directives syntax and preprocessing as `Sprockets <http://guides.rubyonrails.org/asset_pipeline.html#manifest-files-and-directives>`_
just put your manifest files in the
Example
-------
stylesheets::
*= require application/styles/fonts/lato
*= require application/styles/fonts/awesome
scripts::
//= require foundation/jquery
//= require foundation
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-staticassets-0.1.macosx-10.8-x86_64.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42759a4aa0593f3795bb19aca42c6d39b9422d51db588b202939d86c5cd322d6 |
|
MD5 | 272bd13b81a7d5b2d36b0e8bbc2cfb26 |
|
BLAKE2b-256 | 80740819d28b8c1a212fd06236f482f534ed5ed74ff69804bd4c405bc8705db0 |