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:
-
Jul 15, 2008, 10:38:05 PM (16 years ago)
- Author:
-
cmlenz
- Comment:
-
More detailed notes on routes in routing config files
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v7
|
v8
|
|
26 | 26 | * the '''target''' function that should handle requests matching that pattern (optional). |
27 | 27 | |
28 | | Additional indented lines can be provided below any route to set default values for parameters that get passed on to the request handler. The value of these parameters can be any Python expression. |
| 28 | Variable parts in the path pattern consists of the variable name and an optional regular expression that needs to be matched, separated by a colon. If no regular expression is specified, the default is `[^/]+`, meaning that the part will match a single URL segment until the next slash. |
| 29 | |
| 30 | Additional indented lines can be provided below any route to set default values for parameters that get passed on to the request handler. The value of these parameters can be any Python expression. String values are interpolated, with the special `%(here)s` placeholder being substituted by the absolute path to the directory containing the routing configuration file. |
29 | 31 | |
30 | 32 | If no name is specified for a route, URLs for that route can not be generated by name, but only based on the function object. If no target is specified, the route is only used for generating links, not for dispatching requests. |