Forums

Read only database

Hi guys,

I am exploring making a web app that will have pages that query a database, process the data, and display the data. It will never be changed based on the web app interactions (think stats for sports). I want to make this a mySQL database that would be updated ~once daily (as stats for new games are available).

I am confused how to do this using pythonanywhere. One option would be for a local machine to update the database, but that requires external access which doesn't seem to be popular. Another option might be to load the update scripts to my pythonanywhere and run them on consoles (this assuming I upgrade to a better account in the near future)?

I guess I'm just not sure the best way to accomplish this. Every web app example I can find uses databases that change based on the interactions in the web app, not a read-only one like I am doing here. My apologies if this is an obvious answer.

Thanks!

I'd recommend uploading the scripts to PythonAnywhere and then using a Scheduled Task to run them rather than a console. Apart from that, that sounds like a pretty good setup!

If you need a bit more detail, which web framework are you planning to use?

This is for a flask web-app. I wasn't aware of the task scheduler, but it sounds like the right solution. I'm going to give this a try. Thanks for the recommendation!

No problem! Let us know if you have any questions.