From 14e7203bca8c3b0b9fdf053bae309e7fe48b1bef Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 26 May 2021 13:56:20 +0200 Subject: [PATCH] init frontend --- ITPlanning/app.py | 9 +++++++-- ITPlanning/frontend/__init__.py | 8 ++++++++ ITPlanning/view/index.html | 7 +++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 ITPlanning/view/index.html diff --git a/ITPlanning/app.py b/ITPlanning/app.py index f73b59f..a3fd583 100644 --- a/ITPlanning/app.py +++ b/ITPlanning/app.py @@ -4,9 +4,10 @@ from logging.handlers import TimedRotatingFileHandler from flask import Flask from pony.flask import Pony from ITPlanning.api import api -#from ITPlanning.frontend import frontend from ITPlanning.db import init_database from ITPlanning.config import IniConfig +from ITPlanning.frontend import frontend + logger = logging.getLogger("ITPlanning") @@ -29,7 +30,11 @@ def create_app(): logger.setLevel(getattr(logging, loglevel.upper(), logging.NOTSET)) # Initialize database - logger.warning(app.config["BASE"]["database_uri"]) init_database(app.config["BASE"]["database_uri"]) Pony(app) + + # create flask blueprint + app.register_blueprint(api, url_prefix="/api/v1") + app.register_blueprint(frontend) + return app diff --git a/ITPlanning/frontend/__init__.py b/ITPlanning/frontend/__init__.py index e69de29..51d4b8a 100644 --- a/ITPlanning/frontend/__init__.py +++ b/ITPlanning/frontend/__init__.py @@ -0,0 +1,8 @@ +from flask import Blueprint, render_template + +frontend = Blueprint("frontend", __name__) + + +@frontend.route("/") +def index(): + return render_template("index.html") diff --git a/ITPlanning/view/index.html b/ITPlanning/view/index.html new file mode 100644 index 0000000..fd64ba1 --- /dev/null +++ b/ITPlanning/view/index.html @@ -0,0 +1,7 @@ + + + +ITPLANNING! + + +