Michael Merickel
2018-10-15 bda1306749c62ef4f11cfe567ed7d56c8ad94240
commit | author | age
44494c 1 from pyramid.view import view_config
CM 2 from pyramid.wsgi import wsgiapp2
3
0c29cf 4
44494c 5 @view_config(name='hello', renderer='string')
CM 6 @wsgiapp2
7 def hello(environ, start_response):
8     assert environ['PATH_INFO'] == '/'
9     assert environ['SCRIPT_NAME'] == '/hello'
10     response_headers = [('Content-Type', 'text/plain')]
11     start_response('200 OK', response_headers)
954999 12     return [b'Hello!']
44494c 13
0c29cf 14
44494c 15 def main():
CM 16     from pyramid.config import Configurator
0c29cf 17
44494c 18     c = Configurator()
CM 19     c.scan()
20     return c