-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fifthaccess
committed
Mar 1, 2022
1 parent
410383f
commit 449b971
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
from flask import Flask | ||
from model import Todoitem, db | ||
from models import Kuenstler,Lied,LiedKuenstler,Manager,db | ||
from flask.templating import render_template | ||
from addItemForm import AddItemForm | ||
app = Flask(__name__) | ||
app.secret_key = "fifth" | ||
|
||
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False | ||
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql://root:root@localhost/Projekt_06" | ||
|
||
db.init_app(app) | ||
|
||
#test = Todoitem | ||
#test.__tablename__ = "test " | ||
@app.route("/", methods=["get","post"]) | ||
def index(): | ||
|
||
addItemFormObject = AddItemForm() | ||
items = db.session.query(Lied).all() | ||
return render_template("index.html", headline="Todo Items", form = addItemFormObject, items = items) | ||
|
||
|
||
app.run(debug=True) |