Skip to main content

Keep various JavaScript/CSS libraries updated within a Django package

Project description

Source: https://github.com/claudep/django-remote-finder

Download: https://pypi.python.org/pypi/django-remote-finder

This is a simple package designed to solve the annoying problem of having to keep various javascript/css libraries updated within a Django package. A requirements.txt file allows us to specify external Python dependencies, but there is still no good way to keep Javascript dependencies outside the repository. Until now.

Get started by adding the following to settings.py:

# if omitted, default to {settings.STATIC_ROOT}/remote_finder_cache
REMOTE_FINDER_CACHE_DIR = '/path/to/staticfile/cache'

REMOTE_FINDER_RESOURCES = [
    ('jquery.min.js', 'http://code.jquery.com/jquery-2.0.2.min.js', 'sha1:1e0331b6dd11e6b511d2e3d75805f5ccdb3b83df'),
]

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'remote_finder.RemoteFinder',
)

And then e.g. in a template, you can write:

{% load static %}
<script src="{% static "jquery.min.js" %}"></script>

No more need to keep such files in the repository! ./manage.py runserver (with DEBUG=True) will download the files as needed, as will ./manage.py collectstatic.

NOTE: the Django documentation says “Static file finders are currently considered a private interface, and this interface is thus undocumented.” As such, this package may break unexpectedly in the future. See https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATICFILES_FINDERS for details.

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_remote_finder-0.5.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

django_remote_finder-0.5-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file django_remote_finder-0.5.tar.gz.

File metadata

  • Download URL: django_remote_finder-0.5.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for django_remote_finder-0.5.tar.gz
Algorithm Hash digest
SHA256 acf25037f9396816f071481eaeb3c30f6f8759883eee11262e4938606ee6847c
MD5 99c760f2e3e8bb900246136c7999b50a
BLAKE2b-256 d6302b1525cc740110d0ea782a4c765acb22ff06dea4e3ecb602ed4949cb09d8

See more details on using hashes here.

File details

Details for the file django_remote_finder-0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for django_remote_finder-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fda9f1286e6f0dcdae1bcb3e97bf93a237d74ddb4d9391eaf5a76fcc1c836d12
MD5 d0a83bdc5314973951f7bc495875389e
BLAKE2b-256 ea12c57763267c550e6a113218e6e082767d5aa591bde49143c94ec505ce941f

See more details on using hashes here.

Supported by

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