|
|
Create flexible, agile web applications using the power of Grok–a Python web framework
Develop efficient and powerful web applications and web sites from start to finish using Grok, which is based on Zope 3 Integrate your applications or web sites with relational databases easily Extend your applications using the power of the Zope Toolkit Easy-to-follow and packed with practical, working code with clear explanations
In Detail
Python is a very popular language for web application development. It’s easy to learn and powerful enough to program any kind of system. There are many options for Python web development frameworks, from lightweight packages to everything-and-the-kitchen sink solutions. However, Grok offers a solid foundation for developing powerful, extensible, and secure web applications without too much complexity. This is because it is based on a very advanced object-oriented web framework: Zope 3. Grok enables web developers to tap into the power of Zope 3, thus giving a range of useful features for our applications with very little code.
This book offers Python developers a comprehensive understanding of Grok and a look at its main features by way of developing and evolving a sample application from concept to deployment. You will learn how to use Grok to create web applications and how Grok offers you an agile and enjoyable development experience.
This book will introduce you to the Grok web development framework and show you how to create an application from start to finish. You will learn how to create an application using mostly page templates and then add features to it while reworking the code as it grows. You will learn how to use models to describe your application’s domain and how to connect those models to views for presenting information to your users. You will also learn how to automatically generate forms from the models and how to store the data and make it searchable. Due to the public nature of the Web, security is an important part of any web application and you will learn how Grok’s integrated security can be used to protect your application and grant access to specific users and roles when needed. Grok offers a powerful object database for storage, but can also interact nicely with any database directly or using an object-relational mapper. You will learn how to do both and when it’s advisable to use each. You will also learn how to extend a third-party Grok application, how to debug it, and how to deploy it. By the end of the book, you will be able to design and develop a complete web application using Grok.
What you will learn from this book
Basic concepts of the Zope Component Architecture Use Zope Page Templates to produce HTML pages Design efficient applications using models and views Use Grok’s automatic form generation mechanisms Add selectable themes or skins to your applications Index content from the models you defined and learn how to search this content by querying the catalog, including full text search Understand how the Zope Object Database works and how simple and useful it is Easily connect to other relational databases using SQLAlchemy Create extensions to your applications Understand the various options to deploy your Grok application, and use buildout–a Python-based build system for deploying applications–to create a repeatable deployment
Approach
The book takes a practical approach and dives into code right from the start. After learning how to install Grok, we create a simple application. We work on this application throughout the book, until its deployment in the last chapter.
In each chapter, some new features of Grok will be introduced and explained, then the application will be extended to use them, explaining step-by-step how each feature works.
Who this book is written for
This book is intended for Python developers who want to create web applications but have little or no experience in web development. If you have used other web frameworks but are looking for one that enables you to create more complex applications without losing agility, you will also benefit from this book.
The reader is expected to have some basic Python knowledge and at least a general idea of how a web application works.
User review
Great overview and introduction to Grok and Zope technologies
This is a good book. It’s not `OMG I need to drop all my TurboGears work right now and rewrite everything in Grok` good, but it gives you a good feel for the Grok framework and the Zope toolkit underneath it without being too overwhelming. If you want to learn Grok or Zope web development, or if you just want to see how someone else did it, I’d say this is a good book to read. If, however, you want an architectural description of Zope, or if you’re brand-new to Python, HTML, CSS, and Javascript, this probably isn’t the book for you.
I thoroughly enjoyed the book and though it flowed well and the pacing was appropriate. Great job!
User review
Excellent Introduction
Disclaimer: I received a review copy of this book from the publisher, Packt Publishing.
Note that I haven’t dabbled with Grok nor Zope before. I have some experience in Django and web development in general, however.
Apparently the greatest strength of Grok lies in the way it has been designed. The book starts out with a simple and codewise ugly example that is transformed into a beautiful and extensible application. Through this process it gently explains the core concepts of Grok. I suppose even a caveman should grok it.
There is some technical complexity in the book. It’s probably recommended that the reader has some basic knowledge of web technologies (HTML, CSS, JavaScript) and software architecture (mainly MVC pattern and perhaps adapter as well). This will definitely help a lot. If you already happen to be familiar with another MVC based web framework and wish to learn the basics of Grok, this is the book for you.
Some examples of the book depend on the code available from the publisher’s site. The code has been organized well but it has been documented inadequately. I haven’t managed to run the example code yet though I have some ideas how to proceed further. I would count that as the only downside of the book.
I enjoyed the writing and the structure of the book. There were a few minor typos but nothing really irritating. Overall the book surprised me positively. Now I have a couple of new tools, mainly Grok and ZODB, available at my toolkit.
User review
Very good
Full disclosure:
- I am Carlos’ friend and recent fellow author on a similar topic.
- I have only read less than half of this book so far (chapters 1-5).
- I have not worked through any code examples in the book.
- I have worked with the technologies underlying Grok for a long time; I am not a beginner.
As a result of the above circumstances, this review may be less useful and nonpartisan than another, but any opinions I state below really are truthful.
The good things
- This book is written extremely well. Everything is spelled correctly, individual sentences make sense, and sentences flow very naturally to form paragraphs, paragraphs flow to form sections, sections to chapters, and so on. There are no editorial distractions in this book that I’ve found so far.
- The first half of the book is ordered well and I think a reader will be able to follow along easily. The code examples are easy to understand.
- Carlos isn’t afraid to introduce other common technologies while describing Grok (such as JavaScript); therefore the code samples aren’t as contrived as those I’ve seen in other technical books.
The other things (not necessarily bad, just observations)
- This is not a book about the guts of Grok; you won’t learn how to change Grok by reading this book. It is a book which tells you how to write an application using the Grok API.
- This book is presented in a style where a very small application is progressively expanded to gain features chapter-by-chapter. Usually I’m not much of a fan of this style of tech writing, because it makes you keep a lot of state in your brain, and by the time you get to chapter 15, you’ve forgotten some of the basics you learned in chapter 2. But since the book is written very well, and since it doesn’t waste a lot of time on distractions, it actually seems fine here.
You should almost certainly buy this book if:
- You are someone thinking of writing a web application using Grok
- You don’t want to write a web app in Grok but you are curious about Zope or Grok technologies for comparative purposes (maybe you using a competing framework).
- You are an aspiring technical author and you want an example of how an introductory book should be written.

