[Grok-dev] Using static resources from a sub-package?

Kevin Teague kevin at bud.ca
Thu Mar 17 20:06:06 EDT 2011


Using Grok 1.3 with the new fanstatic package, it doesn't seem like
the static directory can be accessed if the View is contained within a
sub-package of the main application package.

For example, given 'testproject' with this layout:

./src/testproject/app.py
./src/testproject/app_templates/index.pt
./src/testproject/pages/thing.py
./src/testproject/pages/thing_templates/thing.pt

Then the template in app_templates has no problem using something like
the example link to a static directory:

<img tal:attributes="src static/evencaveman.jpg"/>

Move this line into the thing.pt template in a sub-package though, and
the static variable for the View is being set to None. And things
break :(

So this seems like a bug to me ... unless sub-packages are not being
supported or something else? Anyone else noticed this?


More information about the Grok-dev mailing list