0
votes

I have installed both DjangoRest framework and Mongo Engine using pip, included rest_framework_mongoengine in INSTALLED_APPS list. Still exception is being thrown when I run server.

File "/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/utils/autoreload.py", line 227, in wrapper fn(*args, **kwargs)

File "/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run autoreload.raise_last_exception()

File "/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception six.reraise(*_exception)

File "/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/utils/autoreload.py", line 227, in wrapper fn(*args, **kwargs)

File "/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/init.py", line 27, in setup apps.populate(settings.INSTALLED_APPS)

File "/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry)

File "/Users/anum/Desktop/Python/ConnectBox/env/lib/python2.7/site-packages/django/apps/config.py", line 94, in create module = import_module(entry)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module import(name)

ImportError: No module named rest_framework_mongoengine

Here is my Settings.py.

Using pip list command, following packages were listed down:

Django (1.11.2)
djangorestframework (3.6.3)
mongoadmin (0.2)
mongodbforms (0.3)
mongoengine (0.13.0)
pip (9.0.1)
PyJWT (1.5.2)
pymongo (3.4.0)
pytz (2017.2)
setuptools (36.0.1)
six (1.10.0)
wheel (0.29.0)

Please help me to get in right direction.. Thanks.

4

4 Answers

3
votes

Try to install:

pip install django-rest-framework-mongoengine

2
votes

You need to install rest_framework_mongoengine; it is a separate package.

0
votes

You need to install mongo engine package
from pypi
pip install django-rest-framework-mongoengine

from github

  • download some release from github, unpack somewhere.
  • copy subdir unpacked_path/rest_framework_mongoengine into your django project or inside python path
  • or, install using pip unpacked_path

Include the packages in Django settings.

INSTALLED_APPS = (

...
'rest_framework'
'rest_framework_mongoengine',
...

)

For More Ref: https://github.com/umutbozkurt/django-rest-framework-mongoengine

0
votes

add these in settings.py file

INSTALLED_APPS = (

... 'rest_framework', 'rest_framework_mongoengine', ... )

If you are working in virtualenv ,then install this module in python directory path

C:\Python34\Scripts> pip install django-rest-framework-mongoengine

instead of env path C:\Python34\Scripts\env\Scripts> pip install django-rest-framework-mongoengine