Advertisement
xurxosanz

Configure MapProxy with isapi-wsgi

Mar 15th, 2011
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. # WSGI module for use with Apache mod_wsgi
  2.  
  3. import os
  4. from paste.deploy import loadapp
  5.  
  6. # this is not working
  7. # application = loadapp('config:config.ini', relative_to=os.path.dirname(__file__))
  8.  
  9. # placing the path to the etc folder directly
  10. application = loadapp('config:config.ini', relative_to="c:\\gis\\mapproxy_venv\\apvmapproxy\\etc")
  11.  
  12. #
  13. # isapi-wsgi specific
  14. # FROM http://code.google.com/docreader/#p=isapi-wsgi&s=isapi-wsgi&t=IntegrationWithDjango
  15. #
  16. import isapi_wsgi
  17. # The entry points for the ISAPI extension.
  18. def __ExtensionFactory__():
  19.     return isapi_wsgi.ISAPISimpleHandler(application)
  20.  
  21. if __name__=='__main__':
  22.     # If run from the command-line, install ourselves.
  23.     from isapi.install import *
  24.     params = ISAPIParameters()
  25.     # Setup the virtual directories - this is a list of directories our
  26.     # extension uses - in this case only 1.
  27.     # Each extension has a "script map" - this is the mapping of ISAPI
  28.     # extensions.
  29.     sm = [
  30.         ScriptMapParams(Extension="*", Flags=0)
  31.     ]
  32.     vd = VirtualDirParameters(Name="mapproxy",
  33.                               Description = "ISAPI-WSGI ISAPISimpleHandler MapProxy",
  34.                               ScriptMaps = sm,
  35.                               ScriptMapUpdate = "replace"
  36.                               )
  37.     params.VirtualDirs = [vd]
  38.     HandleCommandLine(params)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement