michael@d2m.at  |  +43 (664) 948-8084
You are here: Home Blog 2008 05 23 Grok root-level views

Grok root-level views

by Michael Haubenwallner last modified Jun 26, 2010 10:53 PM

Sometimes you just want to have something sit at http://localhost:8080/ -- and not get automatically redirected to the applications form / admin interface.

Register your module in the context of 'IRootFolder' and provide the 'defaultView' name 'index.html' on any of its view classes.


=== rootlevelviews.py ===

import grok from zope.app.folder.interfaces import IRootFolder

grok.context(IRootFolder)

class Index(grok.View): grok.name('index.html')

=========================

That's one method of doing it, there might be others too.

 

Comment

Posted by Philipp von Weitershausen at 2008-05-25 12:34:02
I'm confused by this example. What is it that you want to do? Just register a couple of views on the root object? If so, then why keep the 'grokdev' class around?

Comment

Posted by d2m at 2008-05-25 16:47:03
Philipp, thanks for pointing that out. Example updated.
Filed under: ,