So i have deployed my first Streamlit app to Heroku.
The app is a dashboard where the user can insert certain parameters and data will be presented to the user.
The data is stored in an SQLite3 DB file and requested as a dataframe and shown to the user.
So I would like to update the database on a daily basis with new CSV files. If I do this on my local PC i need to git commit the changes and push the files to Heroku.
My question: Is there a way for me to only update the Database where the dashboard gets the data from without and present this to the user? Without deployment and git commit.
It seems we have some similarities in our apps. I hope I could help you out with what I know.
Could you please clarify these things to help me understand your situation:
Your SQLite3 DB file is stored locally?
where the dashboard gets the data from
Meaning the local storage?
How will you be updating the Database? You open a CSV file, add it to the database, and user from another unit will see your data?
The SQLite3 DB is a DB file which is created and stored in the app.py folder.
So to elaborate on what I did -
I have made an ‘Input’ folder where I store CSV files that needs to be loaded into the SQLite DB.
After running the app.py file the data in the CSV files are automatically loaded in the SQLite3 database. Then i made a dashboard where the user can give in certain inputs and a table and graph is then presented to the user.
The problem is when i want to update the DB with new CSV files, I have the add the CSV files locally to the Input folder and git push heroku master the changes to the herokuapp. Then i can run the functions to update the database with the new CSV data.
My question: is there a way to update the SQLITE3 DB file, which is stored in the heroku repository, without doing it first locally and commiting the changes to Heroku.
Since your app is already hosted on heroku, I think committing really is redundant on your case. Maybe you could set up an update function on your app, where it asks for the files to be uploaded, then runs mainDB.append(updateCSV, ignore_index=True). Then output the file with to_csv() and overwrite the current mainDB.
This way, you just open your herokuapp and drag your CSV files to a file uploader and run the update function.
How about using a cloud database like mongodb or postgresql? If I update the database with CSVs and then run an update function in the streamlit app. Won’t that work?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.