在heroku上部署sqlite db的Django网站

Django website with sqlite db deployment on heroku(在heroku上部署sqlite db的Django网站)
本文介绍了在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网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
FastAPI + Tortoise ORM + FastAPI Users (Python) - Relationship - Many To Many(FastAPI+Tortoise ORM+FastAPI用户(Python)-关系-多对多)
Inserting NaN value into MySQL Database(将NaN值插入MySQL数据库)
Window functions not working in pd.read_sql; Its shows error(窗口函数在pd.read_sql中不起作用;它显示错误)
(Closed) Leaflet.js: How I can Do Editing Geometry On Specific Object I Select Only?((已关闭)Leaflet.js:如何仅在我选择的特定对象上编辑几何图形?)
in sqlite update trigger with multiple if/Case Conditions(在具有多个IF/CASE条件的SQLite UPDATE触发器中)