Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (19 sloc) 0.691 kB
layout title
default
Subdir application

Subdir application

A subdir application lets you run various mount points on the same hostname, but switched based on directory mount point.

This example assumes you have applications already working and called "app" defined in wiki.py, blog.py and auth.py.

Example code

import wiki 
import blog 
import auth 

mapping = ( 
    "/wiki", wiki.app, 
    "/blog", blog.app, 
    "/auth", auth.app) 

app = web.subdir_application(mapping)

if __name__ == '__main__:
    app.run()

Now, going to /wiki/ will send the trailing / to the wiki.app, and its return data will be displayed as normal.

Jump to Line
Something went wrong with that request. Please try again.