I'm a newbie pyramid user, and just landed on this discussion group, so I 
apologize if this question is trivial or already made (and answered), but I 
was not able to find an answer, so...here I am

I'm building and app with pyramid, everything works fine and as expected 
with views, models and so on (I'm not new to web programming and python, so 
I'm quite confident in using this framework with some tutorial to solve 
minor issues).
The problem arise with static routes. 

The default configuration with:
config.add_static_view(name='static', path='static', cache_max_age=3600)
and then ${request.static_url('static/js/global.js')}
works fine, but I'd like to do something more and I'd like to separate 
static files by some means (actually I'll probably have some external 
resources shared with other apps and things like that, but I'm mainly 
trying to understand the underlying design choice). 
My goal would be to have the path read from some configuration file, to 
make it easier to handle different environments.
I understood that config.add_static_view take a name and a path (or, 
better, the beginning of the actual path of the resources) but I expected 
that static_url does a search against name, with some rules, instead it 
looks for a match against the path, so if I change the path, because I move 
shared resources on file system I have to change the code both in the 
config and in the templates using it. Am I right or am I missing something?

What's the reason for this? Why not using the same pattern for non static 
files, where the "name" is the decoupling element?

Any link to the correct manual page or sample is welcome, so don't waste 
your time if I'm just missing an obvious point in pyramid design and 
documentation ;)


thanks in advance





-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to