diff --git a/app.py b/app.py index b1a1554..baadcfd 100644 --- a/app.py +++ b/app.py @@ -33,10 +33,6 @@ class Content(db.Model): player_id = db.Column(db.Integer, db.ForeignKey('player.id'), nullable=True) group_id = db.Column(db.Integer, db.ForeignKey('group.id'), nullable=True) -@app.before_first_request -def create_tables(): - db.create_all() - @app.route('/') def dashboard(): players = Player.query.all() @@ -107,4 +103,6 @@ def player_page(player_id): return render_template('player_page.html', player=player, content=content) if __name__ == '__main__': + with app.app_context(): + db.create_all() # Creează toate tabelele app.run(debug=True) diff --git a/instance/dashboard.db b/instance/dashboard.db new file mode 100644 index 0000000..2be60da Binary files /dev/null and b/instance/dashboard.db differ diff --git a/templates/dashboard.html b/templates/dashboard.html index b3f6a25..b763e5d 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -19,11 +19,12 @@

Groups

Add Group diff --git a/templates/upload_content.html b/templates/upload_content.html index 4f45e75..004ebfc 100644 --- a/templates/upload_content.html +++ b/templates/upload_content.html @@ -20,8 +20,8 @@ {% endfor %} - {% for group_name in groups.keys() %} - + {% for group in groups %} + {% endfor %}