Split Python Flask app into multiple files

Yes, Blueprints are the right way to do it. What you are trying to do can be achieved like this: Main.py from flask import Flask from AccountAPI import account_api app = Flask(__name__) app.register_blueprint(account_api) @app.route(“https://stackoverflow.com/”) def hello(): return “Hello World!” if __name__ == “__main__”: app.run() AccountAPI.py from flask import Blueprint account_api = Blueprint(‘account_api’, __name__) @account_api.route(“/account”) def … Read more