forked from webmaven/appengine-python-morepath-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (24 loc) · 776 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
33
34
"""`main` is the top level module for your Morepath application."""
# Import the Morepath Framework
import morepath
app = morepath.App(name='Hello')
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.path('')
class Root(object):
pass
@app.view(model=Root)
def hello_world(self, request):
"""Return a friendly HTTP greeting."""
return 'Hello World!'
config = morepath.setup()
config.scan()
config.commit()
#@app.errorhandler(404)
#def page_not_found(e):
#"""Return a custom 404 error."""
#return 'Sorry, Nothing at this URL.', 404
#@app.errorhandler(500)
#def page_not_found(e):
#"""Return a custom 500 error."""
#return 'Sorry, unexpected error: {}'.format(e), 500