django-bundledmedia

Django application for adding compressed CSS and JavaScript files in some prepared slots
Download

django-bundledmedia Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Price:
  • FREE
  • Publisher Name:
  • Manuel Saelices
  • Publisher web site:
  • http://yaco.es

django-bundledmedia Tags


django-bundledmedia Description

django-bundledmedia is a Django app for adding compressed CSS and JavaScript files in some prepared slots.This functionality was splitted out of Merengue CMS.Installing- Install package from pypi: easy_install django-bundledmedia- Include bundledmedia in the INSTALLED_APPS setting.- Include bundledmedia.middleware.BundledMediaMiddleware in the MIDDLEWARE_CLASSES setting.UsageIn your base template (i.e. base.html):{% load bundledmedia %}< html > < head > {# placeholder to allow plugins and other templates to add css assets #} {% bundledmedia "css" %} < /head > < body > ... {# placeholder to allow plugins and other templates to add javascript assets #} {% bundledmedia "js" %} < /body >< /html >In your included template (i.e. inc.myblock.html):{% load bundledmedia %}{% addmedia "css" %} < link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/myblock.css"/ >{% endaddmedia %}{% addmedia "js" %} < script language="javascript" src="{{ MEDIA_URL }}js/jquery.myblock.js" >< /script >{% endaddmedia %}...This code will render all chunks of code of all the included templates in the placeholders above.Compressiondjango-bundledmedia uses django-compressor to render compressed CSS and JS when the COMPRESS setting is set to TrueProduct's homepage


django-bundledmedia Related Software