-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
51 lines (48 loc) · 1.82 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
48
49
50
# -*- coding: utf-8 -*-
import os
import re
from datetime import datetime, timedelta
import uuid
import webapp2
import jinja2
from webapp2_extras import sessions
from model import User, Proposal, UserState
from handlers import (MainPage, MeetPage, ShowSummary, ShowProfile,
ProposalsPage,
Propose, AddComment,
TalkPage, ProfilePage, AccountPage,
TestPage, LoginPage, LogoutPage, SignupPage,
SendVerificationEmail, Verify)
import keys
from util import util, xsrf
import logging
from basehandlers import jinja_env
config = {
'webapp2_extras.sessions': {
'secret_key': keys.SESSION_SECRET,
'cookie_args': { 'httponly': True }
},
'webapp2_extras.auth': {
'user_model': 'model.User',
'user_attributes': ['username']
}
}
app = webapp2.WSGIApplication([('/', MainPage),
webapp2.Route('/signup', SignupPage, name='SignupPage'),
webapp2.Route('/send_verification_email', SendVerificationEmail,
name='SendVerificationEmail'),
webapp2.Route('/verify/<encoded_username:.+>-<signup_token:.+>', Verify, name='Verify'),
webapp2.Route('/meet', MeetPage, name='MeetPage'),
webapp2.Route('/meet/show_summary', ShowSummary, name='ShowSummary'),
webapp2.Route('/meet/show_profile', ShowProfile, name='ShowProfile'),
webapp2.Route('/proposals', ProposalsPage, name='ProposalsPage'),
webapp2.Route('/meet/propose', Propose, name='Propose'),
webapp2.Route('/meet/add_comment', AddComment, name='AddComment'),
webapp2.Route('/talk', TalkPage, name='TalkPage'),
webapp2.Route('/profile', ProfilePage, name='ProfilePage'),
webapp2.Route('/account', AccountPage, name='AccountPage'),
('/test123', TestPage),
('/login', LoginPage),
('/logout', LogoutPage)],
config = config,
debug=True)