close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
- Timestamp:
-
Jun 25, 2008, 7:06:14 PM (16 years ago)
- Author:
-
cmlenz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
1 | 1 | = URL Routing and Generation = |
2 | 2 | |
3 | | TBW |
| 3 | The `diva.routing` module provides dispatching of requests to [RequestHandlers request handlers] based on the requested path, as well as the generation of concrete URLs based on the routing. |
| 4 | |
| 5 | == Routing Configuration File == |
| 6 | |
| 7 | While routes can of course be set up programatically, a simple configuration file format is also supported. |
| 8 | |
| 9 | A simple example: |
| 10 | |
| 11 | {{{ |
| 12 | home: / -> geddit.controllers:index |
| 13 | feed: /feed -> geddit.controllers:feed |
| 14 | info: /info/{id} -> geddit.controllers:info |
| 15 | comment: /info/{id}/comment -> geddit.controllers:comment |
| 16 | submit: /submit -> geddit.controllers:submit |
| 17 | |
| 18 | media: /media/{filename:.+} -> diva.static:directory |
| 19 | path = "%(here)s/static/" |
| 20 | }}} |
| 21 | |