Is it possible to deploy Django with Sqlite?

前端 未结 3 1690
慢半拍i
慢半拍i 2021-01-28 05:49

I\'ve built a Django app that uses sqlite (the default database), but I can\'t find anywhere that allows deployment with sqlite. Heroku only works with postgresql, and I\'ve sp

3条回答
  •  [愿得一人]
    2021-01-28 06:17

    SQLite is a database on the disk, it is very useful for development purposes, however services like Heroku expect your server-side code to be stateless, which as a consequence does not really allow for databases such as SQLite. I guess you could make it work (provided you find a place on Heroku's disk where to put your SQLite db) but you would constantly lose your database's content every time you redeploy.

    For Heroku specifically, I'll redirect you to this link which explains how to use Django with PostgreSQL on Heroku.

提交回复
热议问题