Skip to main content

django-staticfiles-downloader provides staticfiles_downloader.DownloaderFinder, an extension of django.contrib.staticfiles, which allows you to specify static files with urls and optionaly checksum in your Django application or Django project settings. This is particularly useful, when using third-party static files, if you don’t want to either include the files in your project nor depend on CDN in runtime.

The static files are collected with python manage.py collectstatic.

Installation

pip install  django-staticfiles-downloader

Configuration

Add staticfiles_downloader.DownloaderFinder to settings.STATICFILES_FINDERS:

STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'staticfiles_downloader.DownloaderFinder',
]

Define static files urls in your Django application

# your_app/__init__.py
staticfiles_urls = {
    # use only url
    'my_app/js/jquery-3.2.1.min.js': 'https://code.jquery.com/jquery-3.2.1.min.js',
    # or use url and checksum
    'my_app/js/jquery-2.2.4.min.js': (
        'https://code.jquery.com/jquery-2.2.4.min.js',
        'sha384',
        'rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB',
    ),
}

Define static files urls in your Django project settings

# your_project/settings.py
STATICFILES_URLS = {
    # use only url
    'js/jquery-3.2.1.min.js': 'https://code.jquery.com/jquery-3.2.1.min.js',
    # or use url and checksum
    'js/jquery-2.2.4.min.js': (
        'https://code.jquery.com/jquery-2.2.4.min.js',
        'sha384',
        'rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB',
    ),
}

Metadata

Release files for django-staticfiles-downloader 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-staticfiles-downloader 1.1.1
File Size Uploaded Provenance Actions
django-staticfiles-downloader-1.1.1.tar.gz 4.9 kB Without provenance Details for django-staticfiles-downloader-1.1.1.tar.gz

Release files / django-staticfiles-downloader-1.1.1.tar.gz

Download URL django-staticfiles-downloader-1.1.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c4e004ecee90eff82e8034ac1eeec954d95446c9b99b5b68b4f14f5c09991842
BLAKE2b-256 checksum
How to use checksums
c95f214c7caa51e77182a85432dbae83cabd39fe1849f3f478337dba5dcebd1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.6 importlib-metadata/5.2.0 keyring/23.13.1 pkginfo/1.8.3 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.7

Security for django-staticfiles-downloader 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page