Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save EdMan1022/68b011a8632fd596fe7245e75d31e36f to your computer and use it in GitHub Desktop.
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.
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment