how to use django with mongoDB

Installing djongo is fairly simple:
pip install djongo
or in most installation with Python3
pip3 install djongo

note that you would need Python 3.6 or higher and MongoDB 3.4 or higher.

After the installation update your your settings.py file to use Djongo as DB Engine:

DATABASES = {
    'default': {
        'ENGINE': 'djongo',
        'NAME': 'django_htmldev',
        'ENFORCE_SCHEMA': False,
    }
}


note the ENFORCE_SCHEMA option that is needed if you want to add fields on the fly without migrations. As a schemaless database MongoDB doesn’t mind but obviously
you need to take that into account in your views (e.g. fill the empty field in the document or exclude them from the view).
You can find the full djongo documenation here