forked from alexksikes/googlemodules
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.py
More file actions
executable file
·69 lines (50 loc) · 2.3 KB
/
application.py
File metadata and controls
executable file
·69 lines (50 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
# Author: Alex Ksikes
# TODO:
# - setup SPF for sendmail and
# - emailerrors should be sent from same domain
# - clean up schema.sql
# - because of a bug in webpy unicode search fails (see models/sql_search.py)
import web
import config
import app.controllers
from app.helpers import custom_error
import forum
urls = (
# front page
'/', 'app.controllers.base.index',
'/page/([0-9]+)/', 'app.controllers.base.list',
# view, add a comment, vote
'/module/([0-9]+)/', 'app.controllers.module.show',
'/module/([0-9]+)/comment/', 'app.controllers.module.comment',
'/module/([0-9]+)/vote/', 'app.controllers.module.vote',
# submit a module
'/submit/', 'app.controllers.submit.submit',
# view author page
'/author/(.*?)/', 'app.controllers.author.show',
# search browse by tag name
'/search/', 'app.controllers.search.search',
'/tag/(.*?)/', 'app.controllers.search.list_by_tag',
# view tag clouds
'/tags/', 'app.controllers.cloud.tag_cloud',
'/authors/', 'app.controllers.cloud.author_cloud',
# table modules
'/modules/(?:by-(.*?)/)?([0-9]+)?/?', 'app.controllers.all_modules.list_by',
# static pages
'/feedback/', 'app.controllers.feedback.send',
'/about/', 'app.controllers.base.about',
'/help/', 'app.controllers.base.help',
# let lighttpd handle in production
'/(?:css|img|js|rss)/.+', 'app.controllers.public.public',
# canonicalize /urls to /urls/
'/(.*[^/])', 'app.controllers.public.redirect',
# mini forum app
'/forum', forum.app,
'/hello/(.*)', 'hello',
# site admin app
# '/admin', admin.app,
)
app = web.application(urls, globals())
custom_error.add(app)
if __name__ == "__main__":
app.run()