Django:使用sqlite3作为数据库在Heroku上部署应用程序 [英] Django: Deploying an application on Heroku with sqlite3 as the database

查看:137
本文介绍了Django:使用sqlite3作为数据库在Heroku上部署应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用sqlite3作为Heroku上的数据库来部署一个应用程序。然而,似乎Heroku不支持使用sqlite3作为数据库的应用程序。是真的吗有没有办法在Heroku上部署我的sqlite3支持的应用程序?

I want to deploy an application with sqlite3 as the database on Heroku. However, it seems to be that Heroku doesn't support applications with sqlite3 as the database. Is it true? Is there no way to deploy my sqlite3-backed application on Heroku?

PS:我已经使用PythonAnywhere成功部署了我的应用程序,但现在想知道是否有可能

PS: I have successfully deployed my application using PythonAnywhere, but would now like to know whether there's any possible way to deploy it using Heroku.

推荐答案

由于Heroku的dynos没有持续部署的文件系统,基于文件像SQLite3这样的数据库是不合适的。这是一个很好的DB开发/快速原型数据库,但是。

As Heroku's dynos don't have a filesystem that persists across deploys, a file-based database like SQLite3 isn't going to be suitable. It's a great DB for development/quick prototypes, though.

Heroku 有一个Postgres提供,但这将适合 - 有一个免费层次和基本的$ 9 /月级别,有利于爱好/小项目。与SQLite相比,最大的好处是您可以获得不会得到的备份(以及所有其他Postgres功能)。

Heroku do have a Postgres offering however that will suit - with a free tier and a basic $9/month tier that are good for hobby/small projects. The biggest benefit over SQLite is that you get backups that you wouldn't get otherwise (plus all the other Postgres features).

有一个指南来更新您的 settings.py 在这里使用Postgres: https://devcenter.heroku.com/articles/getting-started-with-django#django-settings

There's a guide to updating your settings.py to use Postgres here: https://devcenter.heroku.com/articles/getting-started-with-django#django-settings

这篇关于Django:使用sqlite3作为数据库在Heroku上部署应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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