Forked from Jaza/Flask-blueprint-with-imported-routes
Created
November 7, 2017 18:02
-
-
Save EdMan1022/68b011a8632fd596fe7245e75d31e36f to your computer and use it in GitHub Desktop.
Example of how to split a Flask blueprint into multiple files, with routes in each file, and of how to register all those routes.
This file contains hidden or 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
| from flask import Flask | |
| app = Flask(__name__) | |
| app.debug = True | |
| @app.route('/') | |
| def home(): | |
| return 'App home' | |
| from foo import mod | |
| app.register_blueprint(mod, url_prefix='/foo') | |
| if __name__ == '__main__': | |
| app.run() |
This file contains hidden or 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
| * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment