-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
32 lines (28 loc) · 906 Bytes
/
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
#-------------------------------------------------------------------------------
# Name: main
# Purpose:
#
# Author: egrimm
#
# Created: 2016-02-26
# Copyright: (c) egrimm 2016
# Licence: <your licence>
#-------------------------------------------------------------------------------
import webapp2
import handlers
import config
import routes
import logging
webapp2_config = config.config
def handle_404(request, response, exception):
logging.exception(exception)
response.write('Opps! I could swear this page was here a minute ago...')
response.set_status(404)
def handle_500(request, response, exception):
logging.exception(exception)
response.write('Opps! Something went awry!')
response.set_status(500)
app = webapp2.WSGIApplication(config=webapp2_config)
routes.add_routes(app)
app.error_handlers[404] = handle_404
app.error_handlers[500] = handle_500