简体   繁体   中英

Problem to connect the django with mongodb using djongo

How i use

DATABASES = {
    'default': {
        'ENGINE': 'djongo',
        'NAME': 'rede_social',
        'HOST': 'mongodb+srv://blackwolf449:3CErLxvGLPM4rLsK@cluster0.w1ucl2e.mongodb.net/?retryWrites=true&w=majority',
        'USER': 'blackwolf449',
        'PASSWORD': '3CErLxvGLPM4rLsK'
    }
}

Error

django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', 'postgresql', 'sqlite3'

downgrade your django version to 3.0.5

I had the same problem, I fixed it by installing Pytz. Do:

pip install pytz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM