location of environ

8 views
Skip to first unread message

scog

unread,
Dec 6, 2013, 12:13:25 PM12/6/13
to mun...@googlegroups.com
I am looking for the location of the environ that would normally get passed to a wsgi application so that I can get the query string
in my application

thanks

Keith Laaks

unread,
Dec 15, 2013, 5:08:06 AM12/15/13
to mun...@googlegroups.com
Hi.
Not sure exactly what you are asking here.

Maybe this will clarify:
------
from wsgiref.simple_server import make_server

def hello_world_app(environ, start_response):
    status = '200 OK' # HTTP Status
    headers = [('Content-type', 'text/plain')] # HTTP Headers
    start_response(status, headers)

    # The returned object is going to be printed
    return ["Hello World\nPATH:",environ['PATH_INFO'],'\nQUERY_STRING:',environ['QUERY_STRING']]

httpd = make_server('', 8000, hello_world_app)
print "Serving on port 8000..."

httpd.serve_forever()
-----

Keith




--
You received this message because you are subscribed to the Google Groups "muntjac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to muntjac+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages