Author: Pedro Lucas Porcellis <pedrolucasporcellis@gmail.com>
Move basic routing to it's own blueprint
src/__init__.py | 5 ++--- src/blueprints/basic.py | 7 +++++++
diff --git a/src/__init__.py b/src/__init__.py index 38dcb3d3cd5e4738a3d3caa472fec7bdcc77cd31..425f9edb677440bd7e025853e487dcadd99c9a92 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -3,8 +3,7 @@ def create_app(): app = Flask(__name__) - @app.route("/") - def index(): - return render_template('index.html', title = "Feira Virtual Bem da Terra") + from .blueprints.basic import basic + app.register_blueprint(basic) return app diff --git a/src/blueprints/basic.py b/src/blueprints/basic.py new file mode 100644 index 0000000000000000000000000000000000000000..89cb65854af1a4f72abee31f4dea20f8a5aa773d --- /dev/null +++ b/src/blueprints/basic.py @@ -0,0 +1,7 @@ +from flask import Blueprint, render_template + +basic = Blueprint('basic', __name__) + +@basic.route('/') +def index(): + return render_template('index.html', title = "Feira Virtual Bem da Terra")