Mercurial > hg > GlobalNeighbors
view wsgiapp.py @ 22:e69cb496324e
we have a data dump
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 25 Jun 2017 17:45:19 -0700 |
parents | 811adc9736eb |
children | 6891c5523b69 |
line wrap: on
line source
""" WSGI app as appropriate for gunicorn """ import os import sys from globalneighbors.web import GlobalHandler from globalneighbors.web import PassthroughFileserver # paths here = os.path.dirname(os.path.abspath(__file__)) print ("You are here: {}".format(here)) cities1000 = os.environ.get("CITIES1000") if not cities1000: # XXX use a default not really appropriate for production cities1000 = os.path.join(here, 'tests', 'data', 'cities1000.txt') assert os.path.exists(cities1000) # WSGI App application = PassthroughFileserver(GlobalHandler(cities1000)) print ("Finished loading application") sys.stdout.flush()