Skip to content

Instantly share code, notes, and snippets.

@boris317
Created September 17, 2012 23:14
Show Gist options
  • Select an option

  • Save boris317/3740353 to your computer and use it in GitHub Desktop.

Select an option

Save boris317/3740353 to your computer and use it in GitHub Desktop.
import os
class WSGIApp(object):
def __init__(self):
setup_logger(os.environ.get('PYCSW_CONFIG'))
def __call__(self, env, start_repsonse):
""" Do reqeust stuff here """
application = WSGIApp()
if __name__ == '__main__': # run inline using WSGI reference implementation
from wsgiref.simple_server import make_server
port = 8000
if len(sys.argv) > 1:
port = int(sys.argv[1])
httpd = make_server('', port, application)
print "Serving on port %d..." % port
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment