'Where to store database used in Django project?

I am developing a personal website using Django (to learn).

I want to also save it on GitHub.

Where to store the database [file] itself? Not on GitHub?

If I want to make a save a copy of the database in case it vanishes, where does one typically upload their database?

If my website is a "production" website with enough content, what would be the best practice?



Solution 1:[1]

The short answer: with the source files.

When using databases with Client-Server architecture such as MySQL, MongoDB, PostgreSQL, it's better to keep backups safely on servers.

However, SQLite is a server-less database and is self-contained, which is perfect for personal website.

Essentially it's an embedded database which means the DB engine runs as a part of the app.

In this particular situation it's completely fine to keep the database file within app's source files.

Edit: if the plan is to store some important data (e.g. auth), it's better to use some service with cloud DB.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 arcbjorn