Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Integrate django_compressor with celery

Project description

A extension of django_compressor which compress the files by celery workers. The system behind the scene is very simple. The first request on a page with a {% compress %} block will create a celery task which compress this specific block. Instead to wait for the compressed version the first request gets the uncompressed version. After the compress task is finished compressor will deliver the compressed code from the cache directory.

  • Support all features of template inheritance
  • No offline compression by deployment


  • Install as usual django-compressor and celery for django
  • Install django-compressor-celery
  • Add compressor_celery to your installed apps
  • Replace in your template {% load compress %} with {% load compress_celery %}


If you want to change some task options you should use the settings key COMPRESS_CELERY_TASK_CONFIG which contains a dict with the options. (Inspired by django-celery-email)


    'name': 'compressor.lets_compress',
    'queue': 'compressor',
    'ignore_result': False

The default config should work well for the most use cases.

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django_compressor_celery, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size django_compressor_celery-0.2.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

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