Reputation: 13546
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.
Upvotes: 0
Views: 3300
Reputation: 1202
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
Upvotes: 0
Reputation: 343
You need to install mongo engine package
from pypi
pip install django-rest-framework-mongoengine
from github
Include the packages in Django settings.
INSTALLED_APPS = (
...
'rest_framework'
'rest_framework_mongoengine',
...
)
For More Ref: https://github.com/umutbozkurt/django-rest-framework-mongoengine
Upvotes: 0
Reputation: 599490
You need to install rest_framework_mongoengine; it is a separate package.
Upvotes: 2