0

I have already completed a Django server installation and now I want to connect it to a MongoDB database. For that I changed my settings.py file of my project like this:

DATABASES = {
    'default': {
        'ENGINE': 'django_mongodb_engine', 
        'NAME': 'db_name',                   
        'USER': '',
        'PASSWORD': '',
        'HOST': '',                      
        'PORT': '',                      
    }
}

Now when I run in command prompt:

python manage.py runserver

it shows an error:

no module named django_mongodb_engine.base

How can I resolve this error?

Nicolas Cortot
  • 6,591
  • 34
  • 44
arglee
  • 1,374
  • 4
  • 17
  • 30
  • there is a dedicated project because it seems there is no "native" support provided by django ; the project is [django-nonrel](http://django-nonrel.org/) –  Aug 28 '13 at 10:11
  • @FoxMaSk may you please tell what is use of mongodb-engine when we deal with django with no-rel database ? – arglee Aug 28 '13 at 10:23
  • django norel is a project that supports mongodb if this is your question. so after installing it, like you did, [the settings is the following](http://django-mongodb-engine.readthedocs.org/en/latest/reference/settings.html) hope this could help –  Aug 28 '13 at 11:27
  • @FoxMaSk i am using django 1.5 so think i don't need any third party fork for mongodb connection. what i want to know is how to configure settings.py in django project so that it would be connect with mongodb database and can fetch data of json type in django server. – arglee Aug 31 '13 at 07:29
  • I have crated a django 1.5.2 virtualenv and I think you need one third party as the error is when i did `python manage syncdb` : `django.core.exceptions.ImproperlyConfigured: 'django_mongodb_engine' isn't an available database backend. And [the official documentation of django says.... no mongodb](https://docs.djangoproject.com/en/1.5/ref/databases/) Try using 'django.db.backends.XXX', where XXX is one of: u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'` –  Aug 31 '13 at 14:47
  • and [the official documentation of django says.... no mongodb](https://docs.djangoproject.com/en/1.5/ref/databases/) –  Aug 31 '13 at 14:54

1 Answers1

0

Add the following code in settings.py file :-

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.dummy',
        'NAME': 'my-db',
    }
}
max
  • 3,915
  • 2
  • 9
  • 25