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


Release history Release notifications

This version
History Node

0.0.6

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
dj_static_incuna-0.0.6-py2.py3-none-any.whl (4.5 kB) Copy SHA256 hash SHA256 Wheel 2.7 Jun 10, 2014
dj-static-incuna-0.0.6.tar.gz (3.5 kB) Copy SHA256 hash SHA256 Source None Jun 10, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page