Skip to content

Instantly share code, notes, and snippets.

@EliAndrewC
Last active September 5, 2015 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EliAndrewC/8fee43481bfec54ac751 to your computer and use it in GitHub Desktop.
Save EliAndrewC/8fee43481bfec54ac751 to your computer and use it in GitHub Desktop.
Using Flask with Sideboard
"""
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