Skip to content
Newer
Older
100644 30 lines (19 sloc) 691 Bytes
076167e @irrelative edit
irrelative authored
1 ---
2 layout: default
ddd944f @irrelative edit
irrelative authored
3 title: Subdir application
076167e @irrelative edit
irrelative authored
4 ---
5
ddd944f @irrelative edit
irrelative authored
6 # Subdir application
7
8 A subdir application lets you run various mount points on the same hostname, but switched based on directory mount point.
9
10
11 This example assumes you have applications already working and called "app" defined in wiki.py, blog.py and auth.py.
12
13
14 ## Example code
15
16 import wiki
17 import blog
18 import auth
19
20 mapping = (
21 "/wiki", wiki.app,
22 "/blog", blog.app,
23 "/auth", auth.app)
24
25 app = web.subdir_application(mapping)
26
27 if __name__ == '__main__:
28 app.run()
29
076167e @irrelative edit
irrelative authored
30 Now, going to /wiki/ will send the trailing / to the wiki.app, and its return data will be displayed as normal.
Something went wrong with that request. Please try again.