[Grok-dev] automatic static resources

Christian Schmidt grok-list at creativenet.de
Tue Jul 17 12:33:11 UTC 2012


Hello Group,

today I ran into problems with static while i followed the tutorial:

http://grok.zope.org/doc/current/tutorial.html#static-resources-for-our-web-page

I created a static directory, added a styles.css to this directory. 
Finally I worte

<link rel="stylesheet" type="text/css" tal:attributes="href 
static/styles.css">

to my template. Result:

*Line 3, Column 8*
*In expression: <PathExpr standard:u'static/styles.css'>*
- Names:
{'args': (),
'context': <dnszones.app.Dnszones object at 0x808eaab90>,
'default': <object object at 0x800ec4490>,
'loop': {},
'nothing': None,
'options': {},
'repeat': {},
'request': <zope.publisher.browser.BrowserRequest instance 
URL=http://127.0.0.1:8080/dnszones/zone>,
'static': None,
'template': <grokcore.view.components.TrustedFilePageTemplate object at 
0x8087245d0>,
'view': <dnszones.app.DnsZonesZone object at 0x809563350>}
*
- > LocationError: (None, 'styles.css')*

Seems that static Directory is not known. Grok book and tutorial 
references that this is done automaticly. Is there a method where i can 
declare where the static resouces can be found - like 
grok.static('static') in my view or viewlet?

How to make static resources availabe direct form view or viewlet 
template without using fanstatic?

-
Chris


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/grok-dev/attachments/20120717/b019db31/attachment.html>


More information about the Grok-dev mailing list