My favorites | Sign in
Project Logo
             
Code license: New BSD License
Labels: django, caching, css, javascript
Feeds:
People details
Project owners:
  itai.tavor

Farstyle simplifies the management and serving of CSS and JavaScript asset files. Required css or js files, conveniently defined and ordered in the database, are merged and compressed, then inserted into your HTML using a single templatetag. Unique file name used for merged asset files enable far-future caching, with a change in any file causing a new merged asset file to be generated and loaded by browsers.

The merging and optimization process is fully customizable, offering control over both the overall processing of merged assets, as well as the handling of each individual file. CSS and JavaScript files can be individualy exempted from merging or optimization, and custom conditions can be used to group and serve files as separate assets based on request parameters or optional templatetag variables.

Farstyle also helps with the creation of CSS and JavaScript files, by allowing them to be rendered from Django templates. Farstyle searches for files in both template provider locations and static filesystem directories, creating the opportunity to override static files with same-name templates.

For development, merging and optimization are disabled when DEBUG is set to True. In this case individual tags are created for each file, with an added query string parameter which ensures that changed files will always be reloaded by browsers.

A bonus feature enables far future caching of media files, such as large images that rarely change.

Main Features

Credits

Farstyle's database-based specification of CSS and JavaScript files was inspired by django-assetpackager.

The use of customizable filter chains to control optimization and compression of assets was inspired by django-compress, and much of the filtering code was taken from that project.

The Python version of jsmin insluded in Farstyle was translated to Python by Baruch Evan, from the original jsmin implementation by Douglas Crockford.









Hosted by Google Code