6👍
As a beginner, it will probably be easiest to learn Django using sqlite
. You only need to provide a location for the database and to specify sqlite3 as your backend to get it working, which is nice. If you want to use postgres
later, it’ll be more work but it’s still feasible. See @JonathanVanasco’s note in the comments.
If you want to eventually use a NoSQL DB, Django doesn’t support it currently. Here is the list of recognized 3rd party Django backends.
You could use Mongo through a third party fork known as django-nonrel, but this particular implementation doesn’t support ManyToManyFields and has a few other limitations. You can read more about Mongo in django-nonrel at this blog post. There’s some more unofficial documentation on django-nonrel here.
1👍
Postgres is a great database for Django in production. sqlite is amazing to develop with. You will be doing a lot of work to try to not use a RDBMS on your first Django site.
One of the greatest strengths of Django is the smooth full-stack integration, great docs, contrib apps, app ecosystem. Choosing Mongo, you lose a lot of this. GeoDjango also assumes SQL and really loves postgres/postgis above others – and GeoDjango is really awesome.
If you want to use Mongo, I might recommend that you start with something like bottle, flask, tornado, cyclone, or other that are less about the full-stack integration and less assuming about you using a certain ORM. The Django tutorial, for instance, assumes that you are using the ORM with a SQL DB.
- [Django]-How to set default value in Django while filtering objects from models
- [Django]-Connect() to unix:/home/glenn/blog.sock failed (13: Permission denied) while connecting to upstream
- [Django]-Run a Django project from VSCODE
- [Django]-Django Rest Framework – AssertionError in tests
- [Django]-Python–When is timedelta object processed?
0👍
sqlite
is the simplest to start with. If you already know SQL
toss a coin to choose between MySQL
and Postgres
for your first project!
- [Django]-I m confused about the ready function used inside app.py
- [Django]-Formating Django Datetime objects outside template
- [Django]-Create a git repo for project skeleton
- [Django]-Attach permissions and groups to custom User model created from BaseUserAdmin
- [Django]-Fresh mysql database getting "mydb.background_task doesn't exist" – Django
0👍
According to their wiki, Django does not officially support NoSQL databases (a poor decision IMHO). So if you go the NoSQL route on Django, you’ll need to be comfortable dealing with non-standard forks of the project and errors that may not be well documented.
So for beginners on Django, SQL is an obvious choice.
That said, my first DB on Django was a NoSQL one, but I had used SQL databases on other platforms previously.
- [Django]-Django multi-tenant
- [Django]-Django forms client side validation?
- [Django]-Loop over parent ForeignKey
- [Django]-Is there a reason I should be dissuaded from using an alternative templating engine in my Django app?
- [Django]-Django Rest Framework: DRYer pagination for custom actions