Configuring A Static Asset Pipeline With Django And Heroku
refer.ly
refer.ly
https://docs.djangoproject.com/en/dev/howto/static-files/#wi...
Edit: forgot to link to the versioning part in the docs: https://docs.djangoproject.com/en/dev/ref/contrib/staticfile...
Edit edit: ADMIN_MEDIA_PREFIX is also depreciated from 1.4 onwards: https://docs.djangoproject.com/en/1.4/releases/1.4/#django-c...
It's interesting that the CachedStaticFilesStorage will replace urls inside of CSS (as part of the time-stamping), but the standard Storage won't do it to change paths for development/production. As it stands, I use production urls in CSS so that I don't have to change it when I deploy.
This is of course because Django should not be used for serving static files in production. It is has to be handled before it reaches the Application layer i.e. by the web server.
Before Amazon S3 and CloudFront, it used to be the job of Apache or Nginx to serve static content but now that we have cloud based solutions they would be more robust. So it makes sense not to include such production deployment details from Django docs. But it is incredibly useful to have a stand-in functionality while you are in development.
IMHO the official Django docs are some of the best you'll find anywhere of any open source project. My suggestion, though, is to read and re-read and make sure you gather all documented information about $YOUR_TOPIC before formulating your own game plan. For example, here is the chapter on handling static assets in Django:
https://docs.djangoproject.com/en/dev/howto/static-files/
There are a lot of relevant links on that page that are worth following if you want to make sure you a) get the picture and b) know how you want it to all come together for your project.
Lastly, on the topic of storing assets: if you want to offer a Django-ready library for your new cloud storage startup/setup, consider writing your own file storage handler
https://docs.djangoproject.com/en/dev/howto/custom-file-stor...