Writing to a database file

Hi all,

I am trying to create a simple app where users input random data and that data gets stored in a database file. The program works locally on my PC but when I uploaded everything to GitHub the data was not being saved in the file. The app has a function where it shows stored data and it correctly showed the inputted data but was just not storing it in the file.

Is anyone able to help me?

GitHub Pages is designed for static websites and does not support server-side operations, such as writing to a database file.

To overcome this, you will need to use a different hosting solution that supports server-side operations and databases.
May I know what database are you using for the app?

1 Like

Hi @cassteow

For the app I am using a simple .db file.
What other hosting solutions would you recommend?

Some options that you can opt for (I assume you are not looking to use your local file system anymore :smile: ) are MongoDB, MySQL, and PostgreSQL for database services that you can connect to your streamlit app.
Connect Streamlit to MongoDB: Connect Streamlit to MongoDB - Streamlit Docs
Connect Streamlit to MySQL: Connect Streamlit to MySQL - Streamlit Docs
Connect Streamlit to PostgreSQL: Connect Streamlit to PostgreSQL - Streamlit Docs

I hope this helps!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.