Home > database >  If I am using a local SQLAlchemy database, will it keep working if I upload it to CPanel hosting
If I am using a local SQLAlchemy database, will it keep working if I upload it to CPanel hosting

Time:06-14

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!

CodePudding user response:

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.

  • Related