简体   繁体   English

谷歌云运行,Django 和 sqlite

[英]Google Cloud run, Django and sqlite

I'm developing small single user applications in Django. Currently I do so with Heroku, which works just fine.我正在 Django 开发小型单用户应用程序。目前我使用 Heroku 进行开发,它工作得很好。 I would like to deploy the application on Google Cloud run to have in the future a bit more flexibility.我想在 Google Cloud 上部署该应用程序以在将来具有更大的灵活性。

In order to keep the overhead as small as possible I was considering using Sqlite. To keep persistency all I would need is a persistent volume, which could be achived via Google Cloud storage that is mounted into the docker container via gcsfuse.为了使开销尽可能小,我考虑使用 Sqlite。为了保持持久性,我只需要一个持久卷,它可以通过通过 gcsfuse 安装到 docker 容器中的谷歌云存储来实现。 But here is the issue.但这就是问题所在。 I can't find a small Image with python and gcsfuse.我找不到带有 python 和 gcsfuse 的小图像。 I'm not a docker pro.我不是 docker 专业人士。 Just getting started...刚刚开始...

Any help is appreciated.任何帮助表示赞赏。

Google itself provides a HowTo Deploy a (simple) Django app to Google Cloud Run: Google 本身提供了一个 HowTo Deploy a (simple) Django app to Google Cloud Run:

https://codelabs.developers.google.com/codelabs/cloud-run-django/ https://codelabs.developers.google.com/codelabs/cloud-run-django/

I myself as a Google Cloud rookie followed it step by step and it worked without any problems.我自己作为一个谷歌云新手一步一步地跟着它,它没有任何问题。 By the way, I found that via the episode of the podcast Django Chat "Advanced Deployment" with Katie McLaughlin .顺便说一下,我发现通过播客 Django 与 Katie McLaughlin 聊天“高级部署”这一集。

The HowTo use a Cloud SQL instance instead of Sqlite, but this seems to be a good choice: HowTo 使用云 SQL 实例而不是 Sqlite,但这似乎是一个不错的选择:

„Generally speaking SQLite is not a good database choice for professional websites. „一般来说,SQLite 不是专业网站的良好数据库选择。 So while it is fine to use SQLite locally while prototyping an idea, it is rare to actually use SQLite as the database on a production project.“因此,虽然在制作想法原型时在本地使用 SQLite 很好,但在生产项目中实际使用 SQLite 作为数据库的情况很少见。”

William S. Vincent.威廉·文森特。 „Django for Professionals, Chapter 2 „面向专业人士的 Django,第 2 章

Letting this apart it shouldn't be so hard to skip the Cloud SQL step and keep SQLite.分开来看,跳过 Cloud SQL 步骤并保留 SQLite 应该不难。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM