Issue
I am making a web application using Flask and SQLAlchemy. Currently, the database is saved locally:
db = SQLAlchemy()
DB_NAME = "database.db"
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{DB_NAME}'
If I upload it to any hosting using CPanel, will the database keep functioning while saved with the other files, or do I need to change the code so I can use their database?
Thank you!
Solution
Looks like cPanel gives you access to a python virtualenv to run flask apps, so as long as your database.db
file is uploaded along the rest of your application, you should be able to keep using it.
Answered By - ljmc
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.