[Grok-dev] Re: checked in: megrok.resourcelibrary
Robert Gravina
robert at gravina.com
Wed Aug 6 21:29:18 EDT 2008
On 07/08/2008, at 8:22 AM, Martijn Faassen wrote:
> Wichert Akkerman wrote:
>> Previously Martijn Faassen wrote:
>> Isn't this something that could be setup using config.ini or a wsgi
>> middleware layer? It feels like using python to configure a
>> deployment.
>
> I don't think so. A package may want to ship with resources. Imagine
> a widget that needs a javascript file present. Or a package that
> implements a layout that needs some images. Or a package that has
> some kss files that expect to work together with Python code.
>
> These resources are often intimately related with the code in the
> Python package. It's also nice to be able to construct a virtual-
> host aware URL for them.
>
> Anyway, this is not new - 'static' in Grok works this way, and Zope
> 2 has been exposing resources for a long time as well.
>
I agree with Martjin here. Nevow (a Twisted web framework) has the
concept of static resources as well, with an API similar to what I see
here, and it works very well for me. Search for "static" in this
documentation:
http://divmod.org/trac/browser/trunk/Nevow/doc/txt/nevow-traversal.txt
The last thing I would want to be doing is having to configure a WSGI
middleware layer just to makes some images/css/js available in my site.
Robert
More information about the Grok-dev
mailing list