Aspen

Filesystem dispatch since 2006

Framework? Use …

django-aspen
Star

Flask-Aspen
Star

Pando
Star

What is filesystem dispatch?

Path in address bar → path on filesystem. Done.

Why should I care?

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.

What about variable path parts?

Capture URL path parts with filesystem paths like www/%year/index.spt.

What the heck is a *.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
 }

Editor Support

Plugins

Visit Aspen on GitHub