URL Mapping with Routes

PyWorks / php|works At a Glance

Location: Atlanta, GA
Dates: Nov. 12 (tutorials)
Nov. 13-14 (main)
Tutorials: 10
Talks: 65
Presented By






Become a sponsor or media sponsor today!
Media Sponsors










Become a sponsor or media sponsor today!
Day #1: November 13, 2008 @ 13:30 – 14:30
Presented by: Mike Naberezny
Talk focus: Python

Routes (http://routes.groovie.org/) is a Python package that provides a solution to the problem, “how do I map URLs to my code?” Its solution is an interesting one, and is actually a re-implementation of a feature from Ruby on Rails. Routes itself has also now been ported to PHP 5 as part of the Horde project (http://dev.horde.org/routes/). Routes is used by the Pylons web framework and other frameworks in Python, and is relatively easy to use as a standalone package.

The Routes method of URL dispatch is based around pattern matching rather than object publishing. For some Python web developers, like those using Django, it may seem different but familiar. For others, like those from the Zope world, it may be quite foreign. For those new to Routes, we'll have an introduction to the basic Routes concepts and how it works.

We'll also dive into the Routes internals and follow some URLs through their recognition phase, learning about how Routes does it job along the way. We'll look at different options and how they affect matching, taking some mystery out of the process. Web developers and framework implementers alike will gain a better understanding of Routes and how to use it effectively.