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
Changelog
=========
- 0.1 initial version
- 0.1.1 fix pypi package missing packages
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
Changelog
=========
- 0.1 initial version
- 0.1.1 fix pypi package missing packages
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
django-staticassets-0.1.1.tar.gz
(13.4 kB
view hashes)
Built Distribution
Close
Hashes for django-staticassets-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48be3879cc553592f69d09ab1b10cf30ffc228939cb4556eabd90024449cc8a1 |
|
MD5 | 64a689b2fe9b3c57c93d42af0fb48020 |
|
BLAKE2b-256 | 1acfbdda557ecfc2fb38b7dd71f828548313afabea17d556c6b9bc8a831d4f16 |
Close
Hashes for django-staticassets-0.1.1.macosx-10.8-x86_64.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | f25d31ab9eae5e451cf90cc9162985768e3d8e283d2f74ba0bea18de1d8445f3 |
|
MD5 | ad4442dbe175e62eb1fe9aa5b986c9ba |
|
BLAKE2b-256 | 6f801ce039291ca9a682ab121bc3fd885a3ae0d70621616911933364a5c163bf |