PacktLib: Grok 1.0 Web Development

Grok 1.0 Web Development

Credits

Foreword

About the Author

Acknowledgement

About the Reviewers

Preface

Getting to Know Grok

Why Grok?

Distinguishing Grok concepts

Other Grok features

How Grok compares to other web frameworks

Summary

Getting Started with Grok

Getting a C compiler

Installing Python

EasyInstall and the Python Package Index (PyPI)

Grok and the Python environment

Virtualenv

What's inside a Grok project?

The Grok admin UI

Summary

Views

Grok views

Zope Page Templates (ZPT)

The to-do list application

Handling form data

Adding static resources

Putting in some JavaScript flourish

Summary

Models

Models and applications

Storing model data

Display logic and application logic

Using containers and multiple models

The Grok introspector

Summary

Forms

A quick demonstration of automatic forms

Interfaces

Schemas

Summary

The Catalog: An Object-Oriented Search Engine

Catalogs and indexes

Adding a simple search function to the application

A brief diversion: Structuring our application for search

Back to search: Using multiple indexes

Indexing different kinds of objects

The catalog admin UI

Types of indexes

Summary

Security

Authentication and authorization

Principals, permissions, and roles

Security policies

Setting up a custom security policy

Adding authentication

Summary

Application Presentation and Page Layout

Viewlets and viewlet managers

Understanding how the pieces fit together

To-do list manager layout

Layers and skins

Adding themes to our application

Summary

Grok and the ZODB

How the ZODB works

Using the ZODB

Adding Blob support to our application

Taking advantage of transactions

ZODB maintenance

Summary

Grok and Relational Databases

Object Relational Mappers

Using a relational database for authentication

Handling database transactions securely

Creating database-backed models and containers

When to use the ZODB versus a relational database

Summary

Key Concepts Behind Grok

The Zope Component Architecture

Extending a Grok application from the outside

Summary

Grokkers, Martian, and Agile Configuration

Agile configuration

The Martian library

Understanding grokkers

Creating our own grokker for zope.sendmail configuration

Summary

Testing and Debugging

Testing

Testing in Grok

Debugging

Summary

Deployment

Moving an application to production mode

Running the paster server in the background

Running Grok behind the Apache web server

More scalability: Adding caching and load balancing

Summary

Index