Hi there,

say hello to a new pyramid user :). This is my very first practical 
experience with Pyramid.

I've registered a static view

    >>> config.add_static_view('images', 'p_started:webapp/app/images', 
cache_max_age=3601)

and all works fine visiting the url 
http://localhost:6543/images/pyramid.png using the browser, so the 
registration it's ok.
You might ask why am I registering a so strange static url? I'm trying to 
integrate pyramid with an external automated system for assets management 
(image optimization, css/js merge and minification). So depending on the 
.ini settings my app will register webapp/app/images or webapp/dist/images 
(to be used in production, with image optimized). Same stuff with css and 
js. I succeded in configuring the same thing with Plone using ++resources++.

The only problem I that request.static_url uses the path and not the name 
registered in add_static_view, causing a value error.

Is there a way to generate a static url using the name "images" registered 
in add_static_view?
I mean:
    >>> ${request.static_url('p_started:images/pyramid.png')}
instead of:
    >>> ${request.static_url('p_started:webapp/app/images/pyramid.png')}
I want to use the name because the path will change depending on the 
deployment settings. 

Thank you in advance for your support.

Best regards, 

davide

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

Reply via email to