在Heroku上部署了sqlite db的Django网站 [英] Django website with sqlite db deployment on heroku

查看:62
本文介绍了在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上的文件系统是临时的,并且不是在dyno之间共享的,因此每次部署时db都会丢失.

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网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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