python - I can't connect mongodb with django -


i use mongoengine. , below settings:

    _mongodb_user = 'user1'     _mongodb_passwd = '12345678'     _mongodb_host = 'mongodb://user1:damian123@ds99999.mlab.com:23932/projekt_dkjp'     _mongodb_name = 'baza1'     _mongodb_database_host = \         'mongodb://%s:%s@%s/%s' \         % (_mongodb_user, _mongodb_passwd, _mongodb_host, _mongodb_name)     mongoengine.connect(_mongodb_name, host=_mongodb_host)     databases = {         'default': {             'engine': '',         },  } 

and when run server see problem:

        file "c:\users\vbox\pycharmprojects\projekt06\projekt\projekt\settings.py", line 90, in          mongoengine.connect(_mongodb_name, host=_mongodb_host)       file "c:\users\vbox\appdata\local\programs\python\python35-32\lib\site-packages\mongoengine\connection.py", line 165, in connect         return get_connection(alias)       file "c:\users\vbox\appdata\local\programs\python\python35-32\lib\site-packages\mongoengine\connection.py", line 128, in get_connection         raise connectionerror("cannot connect database %s :\n%s" % (alias, e))     mongoengine.connection.connectionerror: cannot connect database default :     false not read preference.  

basically, databases should this:

databases = {   'default': {     'engine': 'django.db.backends.sqlite3',     'name': 'mydatabase',    }  } 

source: link

easy understand picture:

enter image description here

a simple doc understand can found here


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -