Skip to main content

Django helpers to use XStatic packages in Django projects

Project description

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

Why?

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 ./manage.py 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 ./manage.py 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:

<head>
{% xstatic jquery %}
{% xstatic jquery.autocomplete %}
</head>

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.

Source Distribution

django-xstatic-0.0.2.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file django-xstatic-0.0.2.tar.gz.

File metadata

File hashes

Hashes for django-xstatic-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b611e2f58aa203aceafae57709c62ccc96a84498bd9d111583ef893498368152
MD5 bd0ebce698353379055b5bcd07b7f643
BLAKE2b-256 3f46bd40dc769ec0cd288fca2bf1ae8e5cfc4822f8bf81c04463355433e1a8b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page