init frontend
This commit is contained in:
parent
f83b3d5f82
commit
14e7203bca
@ -4,9 +4,10 @@ from logging.handlers import TimedRotatingFileHandler
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
from pony.flask import Pony
|
from pony.flask import Pony
|
||||||
from ITPlanning.api import api
|
from ITPlanning.api import api
|
||||||
#from ITPlanning.frontend import frontend
|
|
||||||
from ITPlanning.db import init_database
|
from ITPlanning.db import init_database
|
||||||
from ITPlanning.config import IniConfig
|
from ITPlanning.config import IniConfig
|
||||||
|
from ITPlanning.frontend import frontend
|
||||||
|
|
||||||
logger = logging.getLogger("ITPlanning")
|
logger = logging.getLogger("ITPlanning")
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +30,11 @@ def create_app():
|
|||||||
logger.setLevel(getattr(logging, loglevel.upper(), logging.NOTSET))
|
logger.setLevel(getattr(logging, loglevel.upper(), logging.NOTSET))
|
||||||
|
|
||||||
# Initialize database
|
# Initialize database
|
||||||
logger.warning(app.config["BASE"]["database_uri"])
|
|
||||||
init_database(app.config["BASE"]["database_uri"])
|
init_database(app.config["BASE"]["database_uri"])
|
||||||
Pony(app)
|
Pony(app)
|
||||||
|
|
||||||
|
# create flask blueprint
|
||||||
|
app.register_blueprint(api, url_prefix="/api/v1")
|
||||||
|
app.register_blueprint(frontend)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
from flask import Blueprint, render_template
|
||||||
|
|
||||||
|
frontend = Blueprint("frontend", __name__)
|
||||||
|
|
||||||
|
|
||||||
|
@frontend.route("/")
|
||||||
|
def index():
|
||||||
|
return render_template("index.html")
|
7
ITPlanning/view/index.html
Normal file
7
ITPlanning/view/index.html
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
ITPLANNING!
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<html>
|
Loading…
Reference in New Issue
Block a user