[Grok-dev] Re: absolute url for 'static' ?

Martijn Faassen faassen at startifact.com
Sat Apr 26 16:10:32 EDT 2008


Michael Haubenwallner wrote:
> Inside a grok.View i need to create a stylesheet link to
> a css file in the static folder.
> 
> That is, given an application 'grokdev' and an instance 'test'
> i'd need to return
> 
> http://localhost:8080/test/@@/grokdev/
> 
> I failed using grok.url() and grok.View.url().

In a template this is just like this:

   tal:attributes="href static/myfile.css"

it'll generate a static URL automatically.

In python code in a view, I think you can just do this:

self.static['foo.css']()

Regards,

Martijn



More information about the Grok-dev mailing list