Skip to main content

Serve production static files with Django.

Project description

This is a simple Django middleware utility that allows you to properly serve static assets from production with a WSGI server like Gunicorn.

Django doesn’t recommend the production use of its static file server for a number of reasons. There exists, however, a lovely WSGI application aptly named Static.

It is suitable for the production use of static file serving, unlike Django.

Usage

Configure your static assets in settings.py:

STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/'

Then, update your wsgi.py file to use dj-static:

from django.core.wsgi import get_wsgi_application
from dj_static import Cling

application = Cling(get_wsgi_application())

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

dj-static-incuna-0.0.6.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

dj_static_incuna-0.0.6-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dj-static-incuna-0.0.6.tar.gz.

File metadata

File hashes

Hashes for dj-static-incuna-0.0.6.tar.gz
Algorithm Hash digest
SHA256 4c6390688e3b2fa7c547755f1841c3b82dc01da91324f5926a26b272f5dedf5d
MD5 3eda72bebbb5358037765e153d577a7c
BLAKE2b-256 6cb434a546a721d514ec745b48fc172bd6773922f56dd9658634250bd992d9cd

See more details on using hashes here.

File details

Details for the file dj_static_incuna-0.0.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dj_static_incuna-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e5f19deacd69a6b581eb721eef43375ebcaf36f853c6e75928f6b2adc50da2c2
MD5 a0afe70b021118f8f9ebb991cb39a1db
BLAKE2b-256 4fddcb8e76c2019dc6350643fac1e7a49b54f089452485e6aff80e01e9d57ebd

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