Collectstatic and determine which files need to be updated by comparing their checksum

2016-04-12 Thread Daniel Blasco
Hi,

I posted this in django-users but I think that it goes better here.


I'm using django-storages to upload my static files to Amazon S3 and I'm 
serving my application from Heroku.

In my local development, when I run collectstatic for a second time just 
after the first one, no files are being uploaded to S3 because 
collectstatic checks for the modified_time to determine if the local files 
are newer than the ones in S3. That's fine so far.

The problem is when I deploy to Heroku. Collectstatic is being executed 
from the Heroku server and absolutely all the files are always being 
uploaded to S3, even the ones that have not changed. This is because during 
the deployment Heroku creates a full copy of the source code, and therefore 
all the files have a new modified_time. In my case, it takes almost 10 
minutes to upload ~1000 files for each deployment.

Also, imagine the situation where the modified_times are not being changed 
and I wanted to upload older versions of the static files. I wont be able 
because storage wouldn't allow to upload files with an older modified_time.

I think that a more accurate way to check if a file needs to be replaced 
could be by comparing their checksum/hash and offer this feature for all 
the Storage subclasses. To preserve backwards compatibility, in 
collectstatic command first determine if the storage subclass implements a 
checksum generation and otherwise fallback to modified_time comparison.


What do you think, is this something that makes sense?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/5573aeac-c586-47a6-bc38-dc62c2e4c67a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Land Information System in Django

2016-04-12 Thread Wanjohi Kibui
Hello.Am working on a LIS in django and having difficulties on how to 
handle land services applications by clients and how they are handled in 
the system e.g. How its acted upon by many department each having a role to 
play in the document and changing status from start to completion. Anyone 
who could have done this before to give a green light for my issue 
please?Would be so thankful for the help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d51e2fd7-109d-4db1-9e01-fa673b0a655d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Land Information System in Django

2016-04-12 Thread Claude Paroz
Le mardi 12 avril 2016 20:28:12 UTC+2, Wanjohi Kibui a écrit :
>
> Hello.Am working on a LIS in django and having difficulties on how to 
> handle land services applications by clients and how they are handled in 
> the system e.g. How its acted upon by many department each having a role to 
> play in the document and changing status from start to completion. Anyone 
> who could have done this before to give a green light for my issue 
> please?Would be so thankful for the help.
>

Hi Wanjohi,

I find your question a bit vague, it's a bit difficult to answer without a 
more precise question. Moreover, if the question is GIS-specific, the 
GeoDjango mailing list might be more appropriate.

Cheers,

Claude 

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e26d6a66-7d83-45a5-bad0-00e393364a66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.