django-staticfiles
This is a Django app that provides helpers for serving static files.
Django developers mostly concern themselves with the dynamic parts of web applications – the views and templates that render new for each request. But web applications have other parts: the static media files (images, CSS, Javascript, etc.) that are needed to render a complete web page.
For small projects, this isn’t a big deal, because you can just keep the media somewhere your web server can find it. However, in bigger projects – especially those comprised of multiple apps – dealing with the multiple sets of static files provided by each application starts to get tricky.
That’s what staticfiles is for:
Collecting static files from each of your Django apps (and any other place you specify) into a single location that can easily be served in production.
The main website for django-staticfiles is github.com/jezdez/django-staticfiles where you can also file tickets.
Installation
Use your favorite Python packaging tool to install staticfiles from PyPI, e.g.:
pip install django-staticfiles
You can also install the in-development version of django-staticfiles with pip install django-staticfiles==dev.
Added "staticfiles" to your INSTALLED_APPS setting:
INSTALLED_APPS = [ # ... "staticfiles", ]Set your STATIC_URL setting to the URL that handles serving static files:
STATIC_URL = "/static/"
In development mode (when DEBUG = True) the runserver command will automatically serve static files:
python manage.py runserver
Once you are ready to deploy all static files of your site in a central directory (STATIC_ROOT) to be served by a real webserver (e.g. Apache, Cherokee, Lighttpd, Nginx etc.), use the collectstatic management command:
python manage.py collectstatic
See the webserver’s documentation for descriptions how to setup serving the deployment directory (STATIC_ROOT).
(optional) In case you use Django’s admin app, make sure the ADMIN_MEDIA_PREFIX setting is set correctly to a subpath of STATIC_URL:
ADMIN_MEDIA_PREFIX = STATIC_URL + "admin/"
Metadata
Release files for django-staticfiles 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-staticfiles-1.2.1.tar.gz | 42.6 kB | Without provenance | Details for django-staticfiles-1.2.1.tar.gz |
Release files / django-staticfiles-1.2.1.tar.gz
| Download URL | django-staticfiles-1.2.1.tar.gz |
|---|---|
| Size | 42.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c4371699bb316dc3e0db1ecf07c80d3d72827a789d73b165b0a592875621fe1
|
|
BLAKE2b-256 checksum How to use checksums |
b5f91967f7bcea946697a0523577b394fc412dd391c3a91aa7099f33b0234174
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-staticfiles 1.2.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.