This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

django-precompressed

precompressed is a pluggable application for Django developers who want to serve precompressed (gzipped) static files.

About

Installation

  1. pip install django-precompressed
  2. Add precompressed to your settings.INSTALLED_APPS before 'django.contrib.staticfiles' so that precompressed’s version of {% static %} will be utilized.
  3. Set settings.STATICFILES_STORAGE to one that suits your needs (see Storages below).
  4. Run ./manage.py collectstatic to generate precompressed copies.
  5. Utilize {% static %} template tag when referencing static files where applicable.

Configuration

All settings are optional and specified via the settings.PRECOMPRESSED_SETTINGS dictionary.

  • GZIP_PATTERNS is a tuple of file patterns that are to be gzipped. Defaults to ('*.css', '*.js')
  • DEFAULT_COMPRESS_LEVEL is a number 0-9 that specifies the default compression level. Defaults to 9.
  • accepts_gzip(request) is a function that returns True if the client supports Content-Encoding: gzip
  • get_gzipped_name(name) is a function that translates filenames and URIs to the precompressed version. Defaults to resource.ext becomes resource.gz.ext
  • should_save_gzipped_copy(path) is a function that returns True if the specified file should have a precompressed copy saved. Defaults to file matches GZIP_PATTERNS?

Storages

precompressed.storage.PrecompressedStaticFilesStorage precompressed.storage.CachedPrecompressedStaticFilesStorage

These storages extend Django’s builtin StaticFilesStorage to provide the described precompression behavior. If you use this you’ll probably want to configure your webserver to add the Content-Encoding: gzip header when serving precompressed files.

precompressed.storage.s3boto.PrecompressedS3BotoStorage precompressed.storage.s3boto.CachedPrecompressedS3BotoStorage

These storages extend [django-storages’ S3BotoStorage](http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html) to provide described precompression behavior for files stored on [Amazon Simple Storage Service (Amazon S3)](http://aws.amazon.com/s3/)

The Cached prefixed versions of each utilize [CachedFilesMixin](https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#cachedstaticfilesstorage) and therefore store hashed copies of static files in addition to the precompressed versions.

Release History

Release History

0.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-precompressed-0.0.2.tar.gz (6.9 kB) Copy SHA256 Checksum SHA256 Source Feb 26, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting