gpt4 book ai didi

python - 无法打开数据库文件 - Mayan EDMS

转载 作者:搜寻专家 更新时间:2023-10-30 23:28:42 24 4
gpt4 key购买 nike

我使用的是 Ubuntu 16.04,我安装了 PyCharm 专业版,这样我就可以轻松运行 Django。

我从 https://gitlab.com/mayan-edms/mayan-edms 克隆了 Mayan EDMS在我安装了所有需要的包以在 PyCharm 中运行它之后。

但我无法运行它,因为出现错误“无法打开数据库文件”。

我是 Django 的新手,不知道该怎么做。教程中没有提到如何解决这个问题。

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f9fbe9438c8>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py", line 213, in ensure_connection
self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py", line 189, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/base.py", line 198, in get_new_connection
conn = Database.connect(**conn_params)
sqlite3.OperationalError: unable to open database file

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/runserver.py", line 127, in inner_run
self.check_migrations()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 422, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/executor.py", line 20, in _init_
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/loader.py", line 52, in _init_
self.build_graph()
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/loader.py", line 209, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
self.ensure_schema()
File "/usr/local/lib/python3.5/dist-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py", line 254, in cursor
return self._cursor()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py", line 229, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py", line 213, in ensure_connection
self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/utils.py", line 94, in _exit_
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.5/dist-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py", line 213, in ensure_connection
self.connect()
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/base/base.py", line 189, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/base.py", line 198, in get_new_connection
conn = Database.connect(**conn_params)
django.db.utils.OperationalError: unable to open database file

最佳答案

您需要创建初始数据库,该数据库在开发中默认为 SQLite 数据库。 SQLite 是一个单文件数据库系统。执行:

./manage.py initialsetup

这将创建一个初始数据库,将架构迁移到最新版本并使用一些默认对象填充数据库以使其可用。

这是 Mayan EDMS 部署文档章节的链接:https://docs.mayan-edms.com/chapters/deploying.html

关于python - 无法打开数据库文件 - Mayan EDMS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52479133/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com