After going into the django shell and creating the following entry:
JavaScript
x
6
1
from blinks.models import *
2
q=Questions(
3
questions='What is science?',
4
tags=['science','psychology']
5
)
6
i am not able to use
JavaScript
1
2
1
q.save()
2
i am getting the following error message
JavaScript
1
34
34
1
Traceback (most recent call last):
2
File "<console>", line 1, in <module>
3
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django/db/models/base.py", line 548, in save
4
force_update=force_update, update_fields=update_fields)
5
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django/db/models/base.py", line 668, in save_base
6
result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
7
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django/db/models/manager.py", line 215, in _insert
8
return insert_query(self.model, objs, fields, **kwargs)
9
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django/db/models/query.py", line 1675, in insert_query
10
return query.get_compiler(using=using).execute_sql(return_id)
11
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/djangotoolbox/db/basecompiler.py", line 592, in execute_sql
12
key = self.insert(to_insert, return_id=return_id)
13
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django_mongodb_engine/compiler.py", line 84, in wrapper
14
return func(*args, **kwargs)
15
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django_mongodb_engine/compiler.py", line 387, in insert
16
collection = self.get_collection()
17
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django_mongodb_engine/compiler.py", line 296, in get_collection
18
return self.connection.get_collection(self.query.get_meta().db_table)
19
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django_mongodb_engine/base.py", line 196, in get_collection
20
collection = self.collection_class(self.database, name, **kwargs)
21
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django_mongodb_engine/base.py", line 204, in __getattr__
22
self._connect()
23
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/django_mongodb_engine/base.py", line 261, in _connect
24
self.connection = connection_class(**conn_options)
25
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/pymongo/mongo_client.py", line 322, in __init__
26
username, password, dbase, opts)
27
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/pymongo/client_options.py", line 108, in __init__
28
options = dict([validate(opt, val) for opt, val in iteritems(options)])
29
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/pymongo/common.py", line 425, in validate
30
value = validator(option, value)
31
File "/Users/sunilkumar/blink2/lib/python2.7/site-packages/pymongo/common.py", line 100, in raise_config_error
32
raise ConfigurationError("Unknown option %s" % (key,))
33
DatabaseError: Unknown option auto_start_request
34
My folder structure is as follows:
JavaScript
1
13
13
1
/blink/
2
- blink
3
- __init__.py
4
- settings.py
5
- urls.py
6
- wsgi.py
7
- blinks (app folder)
8
- __init__.py
9
- models.py
10
- views.py
11
- tests.py
12
- manage.py
13
The versions used are:
JavaScript
1
6
1
Python 2.7.5+
2
Django-1.5.11-py2.7
3
pymongo-3.0.1-py2.7
4
django_mongodb_engine-0.5.2-py2.7
5
djangotoolbox-1.6.2-py2.7
6
Is there anything i am missing?
Can somebody please help me on what the problem is? i am new to django and mongodb. I am not able to find the solution anywhere.
Advertisement
Answer
I had to downgrade the pymongo-3.0.1 to pymongo 2.7 which solved the issue. This error is because of the fact that most of the keywords has been changed or deprecated in pymongo-3.0.1.