Login

Tag "collectstatic"

Snippet List

Custom collectstatic that uses etag and md5 digests to determine whether files on S3 have changed

For use with S3 BotoStorage STATICFILES_STORAGE ="storages.backends.s3boto.S3BotoStorage" and AWS_PRELOAD_METADATA = True Custom management command that compares the MD5 sum and etag from S3 and if the two are the same skips file copy. This makes running collect static MUCH faster if you are using git as a source control system which updates timestamps.

  • s3
  • amazon
  • aws
  • boto
  • collectstatic
  • storages
Read More

Coffeescript compilation

All I wanted was for one to one compilation of coffeescript to javascript. * Without special templatetags * Without specifying explicit bundles * Served dynamically in development * Compiled by collectstatic for producton This code is the minimum required for this. There are two things to take into account: * list method to find coffeescript files to compile for collectstatic * find method to find coffeescript equivalent for a js file for django.contrib.staticfiles.views.serve. The list method will use the list method on all finders that come before it in STATICFILES_FINDERS to find all the files that end with .coffee and will return the equivalent .js path with a storage class that knows how to compile the coffeescript. The find method will use the find method on all finders that come before it in STATICFILES_FINDERS to locate the coffeescript file that is actually being requested. It will then compile the coffeescript into a file in settings.CACHE_DIR before serving that file.

  • development
  • staticfiles
  • coffeescript
  • collectstatic
Read More

2 snippets posted so far.