I am trying to configure MongoDB database to Django. I tried a lot of tutorials but still, I am not able to configure.
I followed following tutorials commands.
http://2buntu.com/articles/1451/installing-django-and-mongodb-in-your-virtualenv/
http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html
http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/
I added the following code to setting.py
class.
DATABASES = {
'default': {
'ENGINE' : 'django_mongodb_engine',
'NAME' : 'product'
}
I tried with different version too, but still I could not run this command.
python manage.py runserver
I got following error.
$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
This is my current installed project packages.
$ pip list
django-mongodb-engine (0.6.0)
djangotoolbox (1.8.0)
pip (7.1.2)
pymongo (3.0.3)
setuptools (18.2)
wheel (0.24.0)
Expecting any expert help to do this. I did not find any latest article to do this.
I want to do this project using dijango-1.8
, python 3.x
and using MongoDB
. I code on linux-ubuntu(14.04)
machine, my system has both python 2x,3x version.
=========================After install Dijango 1.8===================
$ python manage.py runserver
/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/djangotoolbox/db/utils.py:1: RemovedInDjango19Warning: The django.db.backends.util module has been renamed. Use django.db.backends.utils instead.
from django.db.backends.util import format_number
/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/djangotoolbox/db/utils.py:1: RemovedInDjango19Warning: The django.db.backends.util module has been renamed. Use django.db.backends.utils instead.
from django.db.backends.util import format_number
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x7fcf8b16ce60>
Traceback (most recent call last):
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 223, in wrapper
fn(*args, **kwargs)
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run
self.check_migrations()
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 164, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 180, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
with self.connection.schema_editor() as editor:
File "/home/umayanga/Desktop/mongoProject/myproject/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 502, in schema_editor
'The SchemaEditorClass attribute of this database wrapper is still None')
NotImplementedError: The SchemaEditorClass attribute of this database wrapper is still None
now pip list.
Django (1.8)
django-mongodb-engine (0.6.0)
djangotoolbox (1.8.0)
pip (7.1.2)
pymongo (3.0.3)
setuptools (18.2)
wheel (0.24.0)
After , big effort,I can configure Dijago.when I install some warning are aper. but I think ,sometime my installing order may be incorrect. I post this , because it may be help to others and if I do some wrong ,I want expert advice.
Installing packages.
Ubuntu terminal code