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
NOTE: As of Grok 1.2, you do not need to use virtualenv. Grok is automatically isolated from the system python environment.
Authentication with Grok
This document tries to explain how to set up custom authentication against your own database (may be it ZODB, a relational database or LDAP) with Grok. It doesn't go into the details of how to query the database, but shows the bits and pieces you need to integrate with Grok.
Basic ORM with megrok.rdb and SQLAlchemy
This how-to describes the basics of connecting to and mapping relational data to python classes via the Object Relational Mapper(ORM) SQLAlchemy using megrok.rdb. It will discuss the process of mapping existing views and tables as well as dynamic creation of new tables.
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.
Eggs, Known Good Sets and developing with unreleased Grok source code
Grok releases are distributed as Python eggs. This gives you the flexibility to easily control what versions of each of the individual python packages that are used to make up a Grok application. Learn why this is a desirable goal, and how you can use this to develop your Grok application based on unreleased versions of Grok checked out from subversion.
Graphical debugging of Grok with Komodo IDE
Set up the Komodo IDE graphical debugger for your Grok project.
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.
Handling file uploads with zope.app.file and zope.file
If you want to handle files in zope, you can use the zope.app.file and zope.file packages.
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 get started with Dolmen
Dolmen is set of libraries to create a CMS. You will learn how to get started with Dolmen.
How to internationalize your application
In this howto, you will learn how to internationalize your code, extract translatable strings and translate your application into an other language.
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 Grok on MS Windows
This HowTo gives instructions for installing Grok on the various flavours of MS Windows. Please note that this HowTo is a _WORK IN PROGRESS_ during the alpha releases of Grok version 1.0 and grokproject version 1.0. TBD denotes To Be Discussed/Determined/Developed/Described/Done
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.
Legal stuff
About license files, source headers, fair use and friends
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.
Profiling Grok - or: what does my application do in the afternoon?
This How-To explains how you can profile your Grok application or Grok/Zope itself. This way you get an idea of the bottlenecks of your application or in other words: where it spends its time.
Releasing software
Steps to take when releasing software.
REST support in Grok
Implementing your own REST web services.
Searching Objects
Indexing the contents of your objects allow you to perform fast complex search operations.
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.
Traversing subpaths in views
You've probably already explored the simple use of a traverse() method to return objects based on what is in the URL but what about doing similar magic on views? It's really simple actually.
Understanding default values for object database backed attributes
Using class attributes as default values in Model objects is a common idiom, understand how this works.
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 a relationfield to express relationships between objects
In this How To you will learn how to create relations between objects both directly and transparently for the user by using the z3c.relationfield and z3c.relationfieldui packages, which are based on the zc.relation package
Using sources in your forms
This How To explains how one can use the zc.sourcefactory package to fill out lists and choices with dynamic content.
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.