[Grok-dev] Accessing the static directory from 1.3 (problem solved)

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu Feb 3 03:28:20 EST 2011


On 2/2/11 11:11 AM, Sebastian Ware wrote:
> For future reference:
>
> Turns out I had messed up my setup.py. The stuff I added is in fact
> there by default and the zcml tag was not needed.

I'm confused by your monologue :)

Where did you add a zcml tag? What stuff was not needed to add?

Anyway:

> then when I try
>
>   tal:attributes="href static/mystyling.css"

This should work, as it should compute the correct URL the resource for 
you in the zpt. Can you confirm this? Note that the "mystyling.css" file 
does not need to exist for the URL to be computed. The "resource" 
objects provided by zope.fanstatic are slightly stupid still in that sense.

> it won't find it the file, and I can't access from the browser using
>
>   localhost:8080/test/@@/protoncms/mystyling.css
>
> either.

The resource URLs will look different now indeed. The one that was 
computed in the ZPT however, should work. Did you try to use that 
computed URL?

Another quick question: did you have the resource publisher WSGI 
component configured in your app's WSGI pipeline? This publisher 
component will recognize the resource URLs and serve them for you.

regards, jw




More information about the Grok-dev mailing list