Combining resources in Python with Flask -
Combining resources in Python with Flask -
i' trying combine 2 independent flask apps illustration below:
from geventwebsocket import websocketserver, resource ...
server = websocketserver(('', 8080), resource({ '/': frontend, '/one': flask_app_one, '/two': flask_app_two})) server.serve_forever() inside each flask app declare total path, isn't suppose relative path, within flask_app_one:
from flask import flask app = flask(__name__) @app.route('/one/ping') def ping(): homecoming 'hello\n' why should specify in @app.route('/one/ping') instead of @app.route('/ping') since traffic /one forwarded corresponding app?
let me know if need additional info kept illustration clean give thanks you
finally have managed called application dispatching , resources found in page:
http://flask.pocoo.org/docs/0.10/patterns/appdispatch/#app-dispatch
thanks
python flask
Comments
Post a Comment