Newer versions of Grok now use fanstatic for delivering static assets.<br><br>Make sure you have something like this in your setup.py<br><br>setup(name=&#39;yourapp&#39;,<br>      version=version,<br>      description=&quot;&quot;,<br>

      long_description=&quot;Your app&quot;,<br>      # Get strings from <a href="http://www.python.org/pypi?%3Aaction=list_classifiers">http://www.python.org/pypi?%3Aaction=list_classifiers</a><br>      classifiers=[],<br>

      keywords=&quot;&quot;,<br>      author=&quot;Someone&quot;,<br>      author_email=&quot;<a href="mailto:dude@somewhere.com">dude@somewhere.com</a>&quot;,<br>      url=&quot;<a href="http://www.somewhere.com">http://www.somewhere.com</a>&quot;,<br>

      license=&quot;&quot;,<br>      package_dir={&#39;&#39;: &#39;src&#39;},<br>      packages=find_packages(&#39;src&#39;),<br>      include_package_data=True,<br>      zip_safe=False,<br>      install_requires=[<br>          &#39;setuptools&#39;,<br>

          &#39;grok&#39;,<br>          &#39;grokui.admin&#39;,<br>          &#39;fanstatic&#39;,<br>          &#39;zope.fanstatic&#39;,<br>          &#39;grokcore.startup&#39;,<br>          &#39;zope.sendmail&#39;,<br>      ],<br>

      entry_points={<br>          &#39;fanstatic.libraries&#39;: [<br>              &#39;your_app = your_app.resource:library&#39;,<br>          ]<br>      },<br>      )<br><br>The entry_points thing is very important. To know why look here: <a href="http://www.fanstatic.org/en/latest/library.html#making-fanstatic-available-in-your-project">http://www.fanstatic.org/en/latest/library.html#making-fanstatic-available-in-your-project</a><br>

<br>Also, fanstatic filter must be declared in your paster.ini file (might be in etc/<a href="http://debug.ini.in">debug.ini.in</a>).<br><br>[DEFAULT]<br>zope_conf = %(here)s/zope.debug.conf<br><br>[server:main]<br>use = egg:Paste#http<br>

host = 8000<br><br>[pipeline:main]<br>pipeline = accesslogging evalexception fanstatic grok<br><br>[filter:accesslogging]<br>use = egg:Paste#translogger<br><br>[filter:evalexception]<br>use = egg:z3c.evalexception#ajax<br>

<br>[filter:fanstatic]<br>use = egg:fanstatic#fanstatic<br>versioning = false<br>recompute_hashes = true<br>debug = true<br><br>[app:grok]<br>use = egg:grokcore.startup#debug<br><br><br>HTH<br><br>--<br>Noe<br><br><div class="gmail_quote">

2012/7/17 Christian Schmidt <span dir="ltr">&lt;<a href="mailto:grok-list@creativenet.de" target="_blank">grok-list@creativenet.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<u></u>


  

<div bgcolor="#ffffff" text="#000000">
<tt>Hello Group,<br>
<br>
today I ran into problems with static while i followed the tutorial:<br>
<br>
<a href="http://grok.zope.org/doc/current/tutorial.html#static-resources-for-our-web-page" target="_blank">http://grok.zope.org/doc/current/tutorial.html#static-resources-for-our-web-page</a><br>
<br>
I created a static directory, added a styles.css to this directory.
Finally I worte<br>
<br>
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; tal:attributes=&quot;href
static/styles.css&quot;&gt;<br>
<br>
to my template. Result:<br>
 <br>
<b>Line 3, Column 8</b><br>
<b>In expression: &lt;PathExpr standard:u&#39;static/styles.css&#39;&gt;</b><br>
- Names:<br>
{&#39;args&#39;: (),<br>
&#39;context&#39;: &lt;dnszones.app.Dnszones object at 0x808eaab90&gt;,<br>
&#39;default&#39;: &lt;object object at 0x800ec4490&gt;,<br>
&#39;loop&#39;: {},<br>
&#39;nothing&#39;: None,<br>
&#39;options&#39;: {},<br>
&#39;repeat&#39;: {},<br>
&#39;request&#39;: &lt;zope.publisher.browser.BrowserRequest instance URL=<a href="http://127.0.0.1:8080/dnszones/zone" target="_blank">http://127.0.0.1:8080/dnszones/zone</a>&gt;,<br>
&#39;static&#39;: None,<br>
&#39;template&#39;: &lt;grokcore.view.components.TrustedFilePageTemplate object
at 0x8087245d0&gt;,<br>
&#39;view&#39;: &lt;dnszones.app.DnsZonesZone object at 0x809563350&gt;}<br>
<b><br>
- &gt; LocationError: (None, &#39;styles.css&#39;)</b><br>
<br>
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(&#39;static&#39;) in my view or
viewlet?<br>
 
<big><br>
How to make static resources availabe direct form view or viewlet
template without using fanstatic?<br>
<br>
-<br>
Chris<br>
</big></tt><br>
<br>
</div>

<br>_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(255,204,102)">---</span><br>
<span style="color:rgb(204,153,51)">Noe Nieto</span><br>
NNieto Consulting Services<br>
M: <a href="mailto:nnieto@noenieto.com" target="_blank">nnieto@noenieto.com</a><br>
W: <a href="http://noenieto.com" target="_blank">http://noenieto.com</a><br>
T:  <a href="https://twitter.com/#%21/tzicatl" target="_blank">@tzicatl</a><br>Li: <a href="http://www.linkedin.com/profile/view?id=84300665" target="_blank">Perfil en LinkedIn</a><br><br>