diff --git a/worblehat/__init__.py b/worblehat/__init__.py index 656c36b..efc82da 100644 --- a/worblehat/__init__.py +++ b/worblehat/__init__.py @@ -13,6 +13,7 @@ def create_app(): app.config.from_object('config.Config') configure_database(app) configure_admin(app) + configure_blueprints(app) @app.route('/') def index(): @@ -94,3 +95,9 @@ def configure_admin(app): admin.add_view(ModelView(Location, db_session)) admin.add_view(ModelView(Bookcase, db_session)) +def configure_blueprints(app): + from worblehat.blueprints.main import main + blueprints = [main] + + for bp in blueprints: + app.register_blueprint(bp) \ No newline at end of file diff --git a/worblehat/blueprints/main.py b/worblehat/blueprints/main.py new file mode 100644 index 0000000..999d0cb --- /dev/null +++ b/worblehat/blueprints/main.py @@ -0,0 +1,7 @@ +from flask import Blueprint, render_template + +main = Blueprint("main", __name__, template_folder="main") + +@main.route('/') +def index(): + return render_template("main/index.html") \ No newline at end of file diff --git a/worblehat/templates/base.html b/worblehat/templates/base.html new file mode 100644 index 0000000..897c318 --- /dev/null +++ b/worblehat/templates/base.html @@ -0,0 +1,16 @@ + + + + + + + + {% block title %} Worblehat {% endblock %} + + + + {% block main %} + + {% endblock %} + + \ No newline at end of file diff --git a/worblehat/templates/main/index.html b/worblehat/templates/main/index.html new file mode 100644 index 0000000..45e167d --- /dev/null +++ b/worblehat/templates/main/index.html @@ -0,0 +1,7 @@ +{% extends 'base.html' %} + +{% block main %} + +

Forside worblehat

+ +{% endblock %} \ No newline at end of file