【发布时间】:2019-03-01 06:02:40
【问题描述】:
我遵循了安装 mongodb 和 django 的教程。我还使用 pip 安装了 djongo,并在我的项目中更新了我的 settings.py 文件。但是,当我运行 python manage.py runserver 时,我得到没有用户身份验证错误。我需要让它在短时间内工作,所以有人帮助我。我错过了什么?
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fc412ba6400>
Traceback (most recent call last):
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
self.check_migrations()
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/core/management/base.py", line 442, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
self.build_graph()
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/db/migrations/loader.py", line 212, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 61, in applied_migrations
if self.has_table():
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/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 "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/django/db/backends/base/introspection.py", line 56, in table_names
return get_names(cursor)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/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 "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/djongo/introspection.py", line 46, in get_table_list
for c in cursor.db_conn.collection_names(False)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/pymongo/database.py", line 715, in collection_names
nameOnly=True, **kws)]
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/pymongo/database.py", line 677, in list_collections
**kwargs)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/pymongo/database.py", line 631, in _list_collections
session=tmp_session)["cursor"]
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/pymongo/database.py", line 514, in _command
client=self.__client)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/pymongo/pool.py", line 579, in command
unacknowledged=unacknowledged)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/pymongo/network.py", line 150, in command
parse_write_concern_error=parse_write_concern_error)
File "/home/habib/.local/share/virtualenvs/habib-HN5dLoHi/lib/python3.6/site-packages/pymongo/helpers.py", line 155, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: there are no users authenticated
【问题讨论】:
标签: python django python-3.x