Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to deploy Django with Sqlite?

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 spent two days trying to switch databases and can't figure it out, so I want to just deploy with sqlite. (This is just a small application.)

A few questions:

  • Is there anywhere I can deploy with sqlite?
  • If so, where/how?
like image 937
123 Avatar asked Jul 14 '26 06:07

123


1 Answers

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.

like image 132
Flavian Hautbois Avatar answered Jul 17 '26 15:07

Flavian Hautbois