Total Pageviews

Saturday, 14 June 2014

django-static-management

 An easy way of managing static (CSS and JS) assets in Django projects, including build scripts.
This project is intended as an easy way to manage multiple static text assets (CSS and Javascript) in a Django projects.

Currently includes:

  • A template tag to echo collections of CSS files;
  • A combination function with optional delimter;
  • A sample Django project using the template tags;
  • JS as well as CSS template tags;
  • A Django management command to combine files (for building);
  • Support for command line minification/compression when building (YUI compressor, JSMin, Icy etc.).
  • Support for filename versioning (using SHA1 sums, file modification times, etc.).
  • Support for versioning other static assets (e.g. images, Flash files, etc.).

Will (eventually) include:

  • Unit tests;
  • Sample web server configuration for Gzip, mod_deflate etc. (since you really shouldn't be serving static assets via Django in production).

Usage

The configuration is intended to be easy to read and use.
Add the static_management directory into your Django application, and included it in installed_apps.
You can include the current version as a git submodule as follows:
git submodule add git://github.com/bradleywright/django-static-management.git django_site_dir/static_management
Substitute django_site_dir with the root directory of your Django application (where manage.py and settings.py live)

from  https://github.com/bradleywright/django-static-management