jamiejackson

Untitled

Jul 21st, 2011
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.40 KB | None | 0 0
  1. # $URL: https://pyisapie.svn.sourceforge.net/svnroot/pyisapie/Tags/1.1.0-rc4/PyISAPIe/Python/Examples/WSGI/Isapi.py $
  2. # $Rev: 95 $ $Date: 2008-01-11 11:07:35 -0800 (Fri, 11 Jan 2008) $
  3. # (C)2008 Phillip Sitbon <[email protected]>
  4. #
  5. """Global ISAPI request handler for use with WSGI applications.
  6.  
  7. This example merges two WSGI applications and also runs scripts
  8. directly.
  9.  
  10. If you don't have either Django or Trac, comment out that section
  11. and the entry in "Apps" and it should work fine.
  12.  
  13. You may also believe that you can run multiple Django projects just
  14. by choosing the DJANGO_SETTINGS_MODULE environment variable based
  15. on the URL, but beware- that is a process-level value you're
  16. changing! I'm not sure if the value is also looked for in the WSGI
  17. environment. For now, I'm just leaving it at one project.
  18.  
  19. I chose to place the root folder under /app for the specific
  20. purpose of making PyISAPIe the wildcard handler for that path only.
  21. For IIS 5.x, all the paths must end in ".py" because an extension
  22. must be associated with a handler.
  23.  
  24. See the install docs for further information, and the WSGI setup
  25. page for specifics about getting this script going.
  26. """
  27. from Http.WSGI import RunWSGI
  28. from Http import Env
  29. # from md5 import md5
  30. # import imp
  31. # import os
  32.  
  33. from flask import Flask
  34. app = Flask(__name__)
  35. app.debug = True
  36.  
  37. def Request():
  38.     Name = Env.SCRIPT_NAME
  39.     return RunWSGI(app(Name))
Advertisement
Add Comment
Please, Sign In to add comment