Skip to main content

Total asset management for Django. Combine and compress your media.

Project description

django-mediagenerator is an asset manager for Django. With django-mediagenerator you can combine and compress your JS and CSS files. It also takes care of automatically versioning your files (including images), so browsers will load an updated version when you change any of your files. This works by adding a version hash to the file name. That way you can still use HTTP caches.

An important advantage of the media generator is that it works in sandboxed hosting environments like App Engine.

With its backend API the media generator allows you to flexibly add new features and adjust it to your needs. It also comes with several backends pre-installed. For example, you can use Sass, Python (via pyjs/Pyjamas), and PyvaScript.

Also, the media generator provides a development mode in which files don’t get combined and compressed. This simplifies debugging because you can easily see which file contains a bug. Moreover, some backends add extra debug information in development mode to further simplify debugging.

Visit the project site for more information.

Changelog

Version 1.4

This is a compatibility release which prepares for the new staticfiles feature in Django 1.3.

Upgrade notes: Use STATICFILES_URL instead of MEDIA_URL from now on. Starting with Django 1.3 this will default to “/static/” instead of “/media/”.

  • App media should from now on be stored in a folder named “static”. You can still use “media” folders, but this might be deprecated in the future (for the sake of having just one standard for reusable apps).

  • STATICFILES_URL must be used instead of MEDIA_URL

  • STATICFILES_DIRS can be used instead of GLOBAL_MEDIA_DIRS

  • STATICFILES_ROOT can be used instead of GENERATED_MEDIA_DIR

Version 1.3.1

  • Improved handling of media variations. This also fixes a bug with using CSS media types in production mode

Version 1.3

  • Added support for setting media type for CSS. E.g.: {% include_media 'bundle.css' media='print' %}

Version 1.2.1

  • Fixed caching problems on runserver when using i18n and LocaleMiddleware

Version 1.2

Upgrade notes: Please add 'mediagenerator.middleware.MediaMiddleware' as the first middleware in your settings.py.

  • Got rid of unnecessary HTTP roundtrips when USE_ETAGS = True

  • Added Django template filter (by default only used for .html files), contributed by Matt Bierner

  • Added media_url() filter which provides access to generated URLs from JS

  • CopyFiles backend can now ignore files matching certain regex patterns

Version 1.1

  • Added Closure compiler backend

  • Added HTML5 cache manifest file backend

  • Fixed Sass support on Linux

  • Updated pyjs filter to latest pyjs repo version

  • “swf” and “ico” files are now copied, too, by default

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-mediagenerator-1.4.zip (33.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page