Chapter 17.1. CherryPy URL Parsing

CherryPy has a special place in the TurboGears framework—it handles incoming requests and ultimately sends the response back to the user. The first thing CherryPy does is parse out the incoming request object into its component parts and stuffs them into the request object. It then takes the path of the incoming request and tries to match it up to the methods of your application’s root class.

In practice, this is straightforward. But the underlying rules can seem a bit complex the first time through. So, we take care of those rules, and then look at some examples that will probably clear things up. Normally, CherryPy looks for the best match (the one that matches the highest number of path elements) and ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.