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