This is embarassing but I've been unable to figure out what's going on.
I'm trying to write a WSGI application that will be running under IIS. As I
understand it, WSGI is a pretty simple API. I have a sample application
running;
def application(environ, start_response):
"""WSGI Application"""
start_response('200 OK', [('Content-type','text/html')])
return ['Hello World!']
This is a very basic WSGI application. IIS passes the environment and
start_response objects and I return an iterable. This doesn't help in
mapping URLs to functions and so forth so I started looking around for a
good framework to manage that stuff. I'd heard good things about Pyramid so
I thought I'd give that a try. When I searched for a WSGI example, I found
this;
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello %(name)s!' % request.matchdict)
if __name__ == '__main__':
config = Configurator()
config.add_route('hello', '/hello/{name}')
config.add_view(hello_world, route_name='hello')
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 8080, app)
server.serve_forever()
This example looks like it's using WSGI since it's calling the
make_wsgi_app() method of the config object but I'm not seeing anything
that I can expose to IIS, i.e. any function with (environ, start_response)
as the parameters. I'm sure it's burried somewhere in app but I haven't
been able to find any examples of how to do it.
Can anyone point me to a simple example using pyramid under IIS?
Thanks
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.