Last active
September 5, 2015 04:28
-
-
Save EliAndrewC/8fee43481bfec54ac751 to your computer and use it in GitHub Desktop.
Using Flask with Sideboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
To use Flask with Sideboard, make a plugin and then put this file in the plugin | |
module's directory, e.g. sideboard/plugins/paper_bag/paper_bag/__init__.py and | |
the Flask site will be available at https://localhost:4443/uber/paper_bag | |
""" | |
import cherrypy | |
from cherrypy import wsgiserver | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello(): | |
return 'Hello World!' | |
handler = wsgiserver.WSGIPathInfoDispatcher({'/': app}) | |
cherrypy.tree.graft(handler, '/paper_bag') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment