Advertisement
Guest User

Untitled

a guest
May 30th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. from flask import Flask
  2. app = Flask(__name__)
  3.  
  4. @app.route("/")
  5. def hello():
  6. return "Hello World!"
  7.  
  8. @app.route("/pi")
  9. def pi():
  10. return "3.1416"
  11.  
  12. if __name__ == "__main__":
  13. app.run()
  14.  
  15. Options +ExecCGI
  16. AddHandler cgi-script .cgi .py .rb
  17. DirectoryIndex index.cgi index.htm
  18.  
  19. #!/usr/bin/env python
  20. from wsgiref.handlers import CGIHandler
  21. from firstflask import app
  22.  
  23. CGIHandler().run(app)
  24.  
  25. Options +ExecCGI
  26. AddHandler cgi-script .cgi .py .rb
  27. DirectoryIndex index.cgi index.htm
  28.  
  29. RewriteEngine On
  30. RewriteRule ^index.cgi/(.*)$ - [S=1]
  31. RewriteRule ^(.*)$ index.cgi/$1 [QSA,L]
  32.  
  33. RewriteEngine On
  34. RewriteCond %{REQUEST_FILENAME} !-f
  35. RewriteRule ^(.*)$ /path/to/the/application.cgi/$1 [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement