如何从GitHub存储库中为Flask Web应用程序对SQLite数据库文件进行更改 [英] How to pull changes to SQLite database file for Flask web app from GitHub repository

查看:52
本文介绍了如何从GitHub存储库中为Flask Web应用程序对SQLite数据库文件进行更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Flask Web应用程序的存储库,该存储库托管在Heroku上并附加到GitHub存储库,该存储库允许用户输入信息,然后将其插入SQLite数据库并显示在网站上.我想将更改拉到存储库(即包含用户提交的信息的数据库)中,因此我可以进行更改而无需清除数据库.但是,当我从GitHub提取信息时,即使用户已提交信息,数据库也没有变化并且保持空白.如何下载编辑后的数据库文件?

I have a repository for a Flask web application, hosted on Heroku and attached to a GitHub repository, that allows users to enter information which is then inserted into a SQLite database, and displayed on the website. I want to pull the changes to the repository, i.e. the database with the user submitted information, so I can make changes without wiping clear the database. However, when I pull from GitHub, the database has no changes and remains empty, even though users have submitted information. How can I download the edited database file?

推荐答案

抱歉,它不能那样工作.当您在heroku中更改文件时,它在GitHub或git repo中不会反映相同的内容.Heroku使用dyno系统,这意味着在重新启动时会重新加载文件.什么都没有保存.您需要为数据库或类似的数据库使用Heroku Postgres

Sorry it doesn't work like that. When you change a file in heroku, it doesn't reflect the same in GitHub or git repo. Heroku uses a dyno system meaning that when a restart happens then the files are reloaded. Nothing is saved. You would need to use Heroku Postgres for your database or something similar

这篇关于如何从GitHub存储库中为Flask Web应用程序对SQLite数据库文件进行更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆