Personal tools
You are here: Home Documentation How-Tos

How-Tos

Shorter, bite-sized tutorials.
Adding AJAX to Grok with KSS
How to setup KSS (Kinetic Style Sheets) in a Grok application; how to start with the framework.
Using Virtualenv for a clean Grok installation
Use the virtualenv python package to cleanly install Grok into it's own fresh environment.
Automatic Form Generation
Grok supports automatic form generation by working with zope.interface, zope.schema and zope.formlib. This how-to will show you how to create an application that uses this feature and also how to use some more advanced widgets than the formlib defaults.
Combine grokproject with the SVN trunk version of Grok
You want to use grokproject to set up a development environment but you also want to develop with the latest and greatest from the SVN trunk. We'll show how to do that.
Customising Fields in Grok AddForm and EditForm
How does one customise attributes of an auto generated Grok Form.
Grok ORM with Storm
This howto describes a simple CRUD application with Grok and Strom.
Grok, Virtual Hosting and Nginx
Configuring the super fast and lightweight Nginx HTTP server to support virtual hosting.
How I Got Grok Talking To CAS
One user's experience connecting his Grok application to a CAS authentication web server, which he probably did the wrong way around, but which he's sharing because at least it worked.
How to pack your ZODB database
The ZODB grows with each write operation. In order to reduce the size of the data.fs file, you need to perform a "pack" operation.
Install multiple Grok apps using zc.buildout
Grok is packaged as Python eggs. zc.buildout is a tool for managing these eggs, and let's you quickly try out or develop a Grok-based project.
Make use of add-ons via eggs
How to include additional third-party code packaged as eggs (using megrok.form as the example).
Placing your Grok project under version control
Which files to keep and which to throw away when you save your Grok project.
Plugging in new template languages
Replace the default template language.
Releasing software
Steps to take when releasing software.
REST support in Grok
Implementing your own REST web services.
Searching Objects
How to index the contents of your objects so that you can search through them.
Selecting the port and interface where Grok listens
By default, your Grok instance will listen for any incoming TCP connection destined for port 8080 on your machine. Here's how to choose a different port, or to select a particular interface on which it should accept connections.
Set custom configurations on a system level that your application can use
Certain properties are best stored persistently inside your application. Other properties are more appropriate to store on a "system" level.
Understanding viewlets
Viewlets is a flexible way to compound html snippets. Learn what they are and how they work.
Use Apache HTTP server with Grok (on Debian Sid)
This Grok How-To gives a step-by-step explanation of how to install and configure Apache HTTP server version 2.2 on Debian Sid to serve Grok Web Applications using the mod_rewrite method.
Use the same view in multiple models
If you have multiple models each with their own views, perhaps you want all views to have access to one view in common.
Using a KSS plugin for Drag-and-Drop
In addition to the core commands that kss.core provides, richer client actions can be plugged into the KSS machinery. In this example, we use a plugin called kss.plugin.yuidnd. This plugin provides drag-and-drop using the Yahoo UI library.
Using KSS actions on a view
In many cases, KSS actions are using methods on a view. In Zope 3, traversing to the view and calling that method is one approach. In Grok, we can set the context to another view instead of a model object, which allows you to reuse the methods of the view through `self.view`.
Using Viewlets for Layout
Viewlets can be used instead of macros to make a flexible layout. This howto shows how they can be used for this purpose.
Writing tests, discovering and running them with grok.testing
Get started writing tests for your Grok project and use grok.testing to automatically discover the tests.
Writing tests, discovering and running them with z3c.testsetup for dummies
This How-to shows you how to get started with writing tests for your Grok project and then use z3c.testsetup to discover the tests.
XML-RPC web services
Implementing XML-RPC web services for your Grok applications is easy.