django12factor
django12factor copied to clipboard
Use sqlite:///db.sqlite3 as the default DATABASE_URL
Django is unusable with in-memory SQLite, because there is no way to run both migrate and runserver on the same one. It's better to provide a default that's usable (and usually perfect) on development environments.
Iirc, the original reason for using sqlite://:memory:
as the default is that it is the Django default for unit tests, thus making running unit tests with the Django test runner possible with d12f.
In my opinion django12factor should not mandate a physical database. In fact, it should be possible to use Django with d12f without using any database at all (yes, this means not relying on most of django.contrib
, but there are valid use cases).
"When using SQLite, the tests will use an in-memory database by default" (from the docs)
This will happen even if the default database is set to a on-disk SQLite database.
"In my opinion django12factor should not mandate a physical database. In fact, it should be possible to use Django with d12f without using any database at all (yes, this means not relying on most of django.contrib, but there are valid use cases)."
I don't think the DATABASES setting will get used at all if the user is not using any database-related things.