graphite-project/graphite-web — pull request #580 by brutasse (2014-01-12 20:25:12+00:00)
Title: Update to Django's standard staticfiles layout

Fixes #563
Refs #349, #328

This PR integrates django's asset manager, the `contrib.staticfiles` app. The basic idea is that static files which are provided by apps (the django admin) or projects (graphite-web's `content` directory) are *collected* in a central location with the proper layout at deployment time.

In development (with `DEBUG=True`) the django development server simply serves the files from their original location. In production files are collected to `/opt/graphite/static` with the `collectstatic` management command and users are told to set an alias from `/static/` to `/opt/graphite/static` in their web server configuration.

The `/opt/graphite/static` directory will contain the graphite static files and the django admin's static files. Things will just work without needing extra manipulation such as [this one](http://obfuscurity.com/2014/01/Graphite-Tip-Django-Admin-Workaround).

For more advanced setups, this also allows doing interesting things like [cache busting](https://docs.djangoproject.com/en/stable/ref/contrib/staticfiles/#cachedstaticfilesstorage) of static files in order to serve them with far-future expire headers.