Thursday, May 17, 2018

Re: Error Djongo MongoDB

test

在 2018年5月18日星期五 UTC+10上午7:09:18,Kadir Guloglu写道:
Hi

I am try to connect MongoDB and I am getting an exception

Thanks for help

CMD

c:\Proje\otomabakv2\otomabak\otomabak>python manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\makemigrations.py", line 92, in handle
    loader.check_consistent_history(connection)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\loader.py", line 275, in check_consistent_history
    applied = recorder.applied_migrations()
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py", line 61, in applied_migrations
    if self.has_table():
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\migrations\recorder.py", line 44, in has_table
    return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py", line 56, in table_names
    return get_names(cursor)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\backends\base\introspection.py", line 51, in get_names
    return sorted(ti.name for ti in self.get_table_list(cursor)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\djongo\introspection.py", line 34, in get_table_list
    for c in cursor.db_conn.collection_names(False)]
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py", line 617, in collection_names
    for result in self.list_collections(session=session, **kws)]
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\database.py", line 586, in list_collections
    ReadPreference.PRIMARY) as (sock_info, slave_okay):
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\mongo_client.py", line 982, in _socket_for_reads
    server = topology.select_server(read_preference)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py", line 224, in select_server
    address))
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py", line 183, in select_servers
    selector, server_timeout, address)
  File "C:\Users\Kadir\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pymongo\topology.py", line 199, in _select_servers_loop
    self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [WinError 10061] No connection could be made because the target machine actively refused it



DATABASES = {
"default": {
'ENGINE': 'djongo',
"NAME": "admin",
"host": "MONGO DB SERVER IP",
"PASSWORD": "PASSWORD",
"USER": "kadirguloglu1",
"PORT": 27017,
},
}

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/69c5887b-8c4c-4643-b700-f0beb2d17a33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment