- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我使用的是 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/
我使用的是 Ubuntu 16.04,我安装了 PyCharm 专业版,这样我就可以轻松运行 Django。 我从 https://gitlab.com/mayan-edms/mayan-edms 克
我还在学习 Django,还有很多未知的东西。 问题是我无法将 .pdf(或任何其他格式)通过 ajax post 方法发送到外部 API。所以在接收端我只得到文件的字符串位置而不是实际的文件。 我已
我按照以下链接中的步骤,在我的 ubuntu 云上构建它,看起来没问题,但不能在我的浏览器上运行。 https://mayan.readthedocs.io/en/v2.1.4/topics/inst
我是一名优秀的程序员,十分优秀!