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
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
