X
X
x4zx2022-01-23 01:33:27
Django
x4zx, 2022-01-23 01:33:27

How to connect MongoDB to Django?

Created a Python project using the Django framework , wanted to change the database from sqlite3 to MongoDB . I googled found several articles but wrote here very old because of the outdated connection method.

At the moment, the database in the settings.py file looks like this:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}

Please tell me the actual way to connect MongoDB to Django .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-01-23
@x4zx

There is no out-of-the-box support, the current way is to choose from https://djangopackages.org/grids/g/mongodb/ there is no full ORM support, various restrictions will pop up, etc. Highly recommended, especially for beginners.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question