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-0.0.5.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file dj-static-0.0.5.tar.gz.

File metadata

  • Download URL: dj-static-0.0.5.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dj-static-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f9349280bcb9a6f58b7dd42fdf3d340689d9bcbeba362781e4b39b383fcff0d4
MD5 59f26443a5293483c8f497b03bc6deca
BLAKE2b-256 16973c61f4e78f9608afa65019deffeaf814bb3cd88ed3da89a9d37bd652bcd2

See more details on using hashes here.

Provenance

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