-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
47 lines (41 loc) · 1.36 KB
/
main.py
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
import os
from webapp2 import WSGIApplication, Route
#Jinja2 template directory
root_dir = os.path.dirname(__file__)
template_dir = os.path.join(root_dir, 'templates')
#Cookie hashing secret.
SECRET = '''Bg0xqIhKPlUA99WZ3$z!8,/UNq}vLYY^o5L>ExWJ#n4n}j,rXN6GMyF<K:jm<Eo_Mc\
Oyy(WV^kPZjV&Q7>!Iy#5B;G>TN[^BPpmKAD),rE1(Gx.62SCg<k5PpiPg/'''
#Check if running on dev server.
debug = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
PAGE_RE = r'(/(?:[a-zA-Z0-9_-]+/?)*)'
app = WSGIApplication([
Route('/signup',
handler='handlers.wiki.Signup',
name='signup'),
Route('/login',
handler='handlers.wiki.Login',
name='login'),
Route('/logout',
handler='handlers.wiki.Logout',
name='logout'),
Route('/_index',
handler='handlers.wiki.Index',
name='Index'),
Route('/_search',
handler='handlers.wiki.Search',
name='Search'),
Route('/_recent',
handler='handlers.wiki.RecentRevisions',
name='_recent'),
Route('/_edit<page_name:' + PAGE_RE + '>',
handler='handlers.wiki.EditPage',
name='_edit'),
Route('/_history<page_name:' + PAGE_RE + '>',
handler='handlers.wiki.HistoryPage',
name='_history'),
Route('<page_name:' + PAGE_RE + '>',
handler='handlers.wiki.WikiPage',
name='WikiPage'),
],
debug=debug)