4

When i am trying to install pip install "git+https://github.com/django-nonrel/mongodb-engine " i am getting an error

ERROR:root:Error while trying to get django settings module.
    Error was: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

And when running app getting this error

raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django.db.backends.django_mongodb_engine' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: No module named django_mongodb_engine.base

What to do.Help me if anyone know...

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
Shiva
  • 988
  • 4
  • 15
  • 31
  • That first error isn't happening during the install. Please show exactly what you typed. – Daniel Roseman Jan 27 '14 at 13:06
  • [root@localhost DBE]# pip install git+https://github.com/django-nonrel/mongodb-engine Downloading/unpacking git+https://github.com/django-nonrel/mongodb-engine Cloning https://github.com/django-nonrel/mongodb-engine to /tmp/pip-gFKmxC-build Running setup.py (path:/tmp/pip-gFKmxC-build/setup.py) egg_info for package from git+https://github.com/django-nonrel/mongodb-engine ERROR:root:Error while trying to get django settings module. Error was: Requested setting INSTALLED_APPS, but settings are not configured – Shiva Jan 27 '14 at 13:17
  • This is the reference i used http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html – Shiva Jan 27 '14 at 13:19
  • Did you do the previous steps on that page? I notice for example that your prompt doesn't show you're running inside a virtualenv, even though the docs say to do so. (And please don't run as root, that's never a good idea.) – Daniel Roseman Jan 27 '14 at 13:29
  • Thanks for giving reply,If i am not running as root,I am getting permissions denied... – Shiva Jan 28 '14 at 17:12
  • @Daniel Roseman, Thanks boss,Its worked – Shiva Mar 03 '14 at 13:07

1 Answers1

1

Looks like the first error is an pip install error. The mongodb-engine package has an odd dependency where it needs to insert itself as an 'app' in your django project. For that reason it needs to know where the appropriate 'settings.py' is.

To do this, point the environment variable DJANGO_SETTINGS_MODULE to the appropriate 'settings.py'. (Yes... its very weird that this is required during a pip install... again to understand why see here).

As for the second error... assuming this is just a ripple from the mongodb-engine backend not being installed correctly in the first place.

whitej125
  • 31
  • 3