Django website with sqlite db deployment on heroku(在heroku上部署sqlite db的Django网站)
问题描述
我在很多地方都读到过 Heroku 不支持 sqlite 数据库.没有使用sqlite的选项吗?是否有任何类型的包装器或插件与 sqlite 一起使用,以便它可以部署在 Heroku 中?任何人都可以共享资源或指南来完成相同的端到端操作吗?
I have been reading at many places that Heroku doesn't support sqlite database. Is there no option to use sqlite? Is there any kind of wrapper or plug-in to be used with sqlite so that it can be deployed in Heroku? Can anyone share resources or guides to do the same end to end?
推荐答案
不,没有办法做到这一点.sqlite 数据库是磁盘上的文件,但 Heroku 上的文件系统是短暂的,并且不会在 dynos 之间共享,因此每次部署时都会丢失数据库.
No, there is no way to do this. An sqlite database is a file on disk, but the filesystem on Heroku is ephemeral and not shared between dynos, so the db would be lost every time you deploy.
但是没有理由去尝试.Django 已经抽象出数据库之间的所有差异以供常规使用.Heroku 支持许多针对不同用例的 Postgres 计划,包括免费的爱好层.
But there is no reason to try. Django already abstracts away all the differences between databases for regular usage. Heroku supports a number of Postgres plans for different use cases, including a free hobby tier.
这篇关于在heroku上部署sqlite db的Django网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在heroku上部署sqlite db的Django网站


- 更改自动增量起始编号? 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- SQL 临时表问题 2022-01-01