Path in address bar → path on filesystem. Done.
You should care about filesystem dispatch if using regular expressions or decorators or object traversal for dispatch makes your heart sink and your head hurt.
Capture URL path parts with filesystem paths like
www/%year/index.spt
.
*.spt
file?A so-called “spitfile” is a simplate, a template with a Python header or two. Here's an example:
import random [----] program = request.qs['program'] excitement = '!' * random.randint(1, 10) [----] text/html via jinja2 <h1>Greetings, {{ program }}{{ excitement }}</h1> [----] text/plain via stdlib_format Greetings, {program}{excitement} [----] application/json via json_dump { "program": program , "excitement": excitement }