Skip to main content

UNKNOWN

Project description

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

Download: https://pypi-hypernode.com/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:

REMOTE_FINDER_CACHE_DIR = '/path/to/staticfile/cache'

REMOTE_FINDER_RESOURCES = [
    ('jquery-2.0.2.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 staticfiles %}
<script src="{% static "jquery-2.0.2.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.3.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file django-remote-finder-0.3.tar.gz.

File metadata

File hashes

Hashes for django-remote-finder-0.3.tar.gz
Algorithm Hash digest
SHA256 3245812858fe15d163378f3bb702a14deb04f6db20aeaa753aa0104624002f13
MD5 4cb6b5ded3bfb787ccfaae91fe628dcf
BLAKE2b-256 ba491a36d4e467148ef5da8c1b8cee7bd721ae4ad0f445e9cf5f12cc42285bbd

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