---
title: "实现一个 django 的 url dispatcher"
author: "huangyiiiiii"
date: "2007-06-25T17:22:14Z"
tags: []
slug: "django-url-dispatcher"
draft: false
lastmod: "2007-06-25T17:22:14Z"
id: 109898
url: "https://codeplayer.iteye.com/blog/109898"
---

心血来潮，实现了一个 django 的 url dispatcher，比想象中简单多了。  
[http://djangodispatcher.googlecode.com/svn/trunk/mapper.py](http://djangodispatcher.googlecode.com/svn/trunk/mapper.py)  
[http://djangodispatcher.googlecode.com/svn/trunk/test.py](http://djangodispatcher.googlecode.com/svn/trunk/test.py)

实际实现功能的代码才2、30行，功能基本完整，包括分层次的url配置，和发生异常时帮助调试用的一些信息。

PS：发现最近爱上了 Test Driven.