首页 > 解决方案 > 无法使用 Django 连接到 firebird 数据库

问题描述

第一次使用 Django,所以我查找了一个教程 - 我点击了这个链接,一切都很好,直到我不得不调整 settings.py 文件,我点击了这个其他链接并得到了这个错误:

django.core.exceptions.ImproperlyConfigured: 'firebird' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'postgresql', 'sqlite3'

我通过 安装了 django-firebird pip install django-firebird,我有一个不同的 python 脚本,它使用import fdb得很好,并且我已经能够使用其他python 脚本定期访问我的 firebird 数据库,那么可能导致这个错误的原因是什么?

ps.:这个这个从作为后续步骤提到的第一个链接分支出来。

标签: pythondjangofirebirdpython-3.8

解决方案


django-firebird 的最后一个稳定版本是 1.11,它与 django 1.11 LTS 兼容。这是推荐使用的版本。检查问题

如果您使用的是Django 2.x ,则需要降级。 但是如果你使用 Python 3.8 你将无法降级!

在这种情况下,我建议使用FlaskSQLAlchemy来与 firebird 集成


推荐阅读