Hi Renato,

Sorry for being a little late to this party.

On Sunday 01 June 2014 17:36:43 Renato Oliveira wrote:
> 
> Yeah, i'm aware of this, and sorry for not being explicit. The goal of this
> improvement is to point to many places. For exampe, if I have a project
> with, bootstrap, jquery and angular. I can do this:
> 
> {% static 'path/to/my/angular.js' http://googlecdn/angular.js %}
> {% static 'path/to/bootstrap.css' http://bootstrapcdn/bootstrap.css %}
> 
> And If I have to write some css or js file,
> 
> {% static 'path/to/users.js' %}
> 
> And this would use Django storage or S3, whatever.

I suspect that your proposal could be acceptable, if, instead of adding HTTP 
sources into the templates, you added a "using=" argument that referenced a 
file-storage object -- similar to the one on the cache tag.

The problem with this idea is that, while caches are named in a settings 
entry, there is currently no such "registry" of file-storage objects. One could 
arguably be added to staticfiles' AppConfig, but that will probably only happen 
if there are more uses for named storages.

Anyway, doing it this way addresses Florian's concerns -- control of which 
named storage goes where stays at the project level, the templates only 
specify grouping of files; and I think it gives most of what you want. 

The only concern I have about it is, it may be over-engineered -- in practice, 
you don't usually have whole sets of files in different storages, and if you 
do, 
you can probably tell the right storage by path; so a simpler solution is a 
custom storage (as Florian pointed) which makes all the decisions.

YMMV,
        Shai.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" 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 http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/201406161812.34475.shai%40platonix.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to