Tutorial : https://www.youtube.com/watch?v=wC3qkE5vD4M
/home/marc/flaskapp ├── app │ ├── section1 │ │ ├── __init__.py │ │ └── ... │ │ │ ├── section2 │ │ ├── __init__.py │ │ └── ... │ │ │ ├── templates │ │ ├── section1 │ │ │ ├── home.html │ │ │ └── ... │ │ │ │ │ ├── section2 │ │ │ ├── home.html │ │ │ └── ... │ │ │ │ │ └── base.html │ │ │ ├── __init__.py │ ├── ... │ ├── home.py │ └── ... ├── run.py └── ...
from flask import Blueprint, render_template home = Blueprint("home", __name__) @home.route("/home") def home_page(): return render_template("index.html")
from flask import Flask from app.home import home app = Flask(__name__) app.register_blueprint(home)
from app import app app.run(host="0.0.0.0", port=8000, debug=True)