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

Django helpers to use XStatic packages in Django projects

Project description

Use XStatic packages and Django StaticFiles to manage your static files like jQuery.


Managing static files is a PAIN, You must download them, unpack them copy them, keep them up to date … Wouldn’t it be cool if you cool just pip install them?

What does it do?

django-xstatic makes the static files from xstatic packages installed in INSTALLED_APPS be collected by ./ collectstatic.

Installation and usage

  1. Install django-xstatic
  2. Add 'django_xstatic.finders.XStaticFinder' to your STATICFILES_FINDERS
  3. Install your xstatic packages and add them to INSTALLED_APPS
  4. Run ./ collectstatic

Open questions

django-xstatic detects xstatic package when they are in the INSTALLED_APPS list. Should it uses its own settings key?

What it should (maybe) do, but doesn’t yet

In the current version, you still have to remember the names of the javascript file names, but wouldn’t you like to have only this in your templates:

{% xstatic jquery %}
{% xstatic jquery.autocomplete %}

xstatic packages comes with a metadata value named LOCATIONS, giving URLs of CDN serving these same static files, django-xstatic should give a template tag to use them easily.

Bonus Feature

It works with django-compressor!

Project details

Download files

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

Files for django-xstatic, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size django-xstatic-0.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