Mercurial > hg > GlobalNeighbors
view wsgiapp.py @ 24:40a9850076a4
[documentation] links
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 04 Sep 2017 14:54:38 -0700 |
parents | 6891c5523b69 |
children |
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) neighbors = '/home/jhammel/GlobalNeighbors/neighbors.dat' assert os.path.exists(neighbors) # WSGI App application = PassthroughFileserver(GlobalHandler(cities1000, neighbors_file=neighbors)) print ("Finished loading application") sys.stdout.flush()