Open EldarU123 opened 4 years ago
I don't understand the use of two seperate database, you can just create one database with multiple tables according to requirements.
But still if you want to use two database then you can refer these resources below : https://www.youtube.com/watch?v=SB5BfYYpXjE https://flask-appbuilder.readthedocs.io/en/latest/multipledbs.html
I'm currently building a flask web application using Microsoft Azure. The basic idea is just a blog for my school which I'm doing as a project. For this web application, I have two html pages. A home page where people just chat and a calendar page. yes not the best ideas but it's sufficient. What i'm wondering is how i select a database for each html page. Since it's like a forum blog type page, I already have the form and the script for that ready but when I enter something, it shows up for all the pages. I've made two databases, database.db for the home page and calendar.db for the calendar page. So far, everything i've been submitting into the forms is going into database.db and not calendar.db for the calendar.html page. So, i've made the database for the calendar page and made a table for it but can't seem to connect it to calendar.db.
Here is my code:
app.py
and then models.py
and finally my html page for the calendar :
my html is not the best.
It would be great if you guys could help me. I've made another models.py with different variables and connected them to calendar.html/calendar.db but that hasn't work. I've done a lot of things and followed the same steps i got database.db to work but I can't figure it out.
Thank you