Anyway, here's what a test looks like: To load controllers we have to import the module, then get the function out of it. We'll use the __import__ builtin to import the module. The return value of __import__ isn't very useful, but it puts the module into sys.modules , a dictionary of all the loaded modules. Also, some people don't know how exactly the string method split works. It takes two arguments -- the first is the character to split on, and the second is the maximum number of splits to do. We want to split on just the first : character, so we'll use a maximum number of splits of 1. Now, the Router class. The class has the add_route method, and also a __call__ method. That __call__ method makes the Router object itself a WSGI application. So when a request comes in, it looks at PATH_INFO (also known as req.path_info ) and hands off the request to the controller that matches that path. line 5 : We are going to keep the route options in an ordered list. Each item will be (regex, controller, vars) : regex is the regular expression object to match against, controller is the controller to run, and vars are any extra (constant) variables. line 8, 9 : We will allow you to call add_route with a string (that will be imported) or a controller object. We test for a string here, and then import it if necessary. line 13 : Here we add a