Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django - what should you do if you don't need a database engine?

If you fail to set a database engine in setting.py you get an error.

Is there some way to disable the database portion of django for a specific site if you don't have a need for a database?

like image 356
Acorn Avatar asked Feb 05 '11 19:02

Acorn


People also ask

Can I use Django without database?

Although you can use Django without a database, it comes with an object-relational mapper in which you describe your database layout in Python code.

Can I use Django without ORM?

Yes that is possible, but a lot of how Django can help is then not available. In that case, Django will look more (in terms of what it can do) like Flask.

Which database should be used with Django?

Django officially supports the following databases: PostgreSQL. MariaDB. MySQL.

Does Django automatically create database?

Django doesn't create databases for you automatically. You have to do this yourself manually. This is a simple package that creates your database for you automatically, if necessary, when you run migrate for the first time.


1 Answers

You may need it if using some of the built in db models that Django offers. Here is a microproject that only has the bare minimum to form a response, so no db is prsent:

https://github.com/radzhome/django_microproject

As you can see the settings.py file is pretty stripped down.

like image 72
radtek Avatar answered Nov 14 '22 19:11

radtek