Django-firebird can not work

為{幸葍}努か 提交于 2021-02-08 03:08:14

问题


I downloaded the folder and put it into C:\Python27\Lib\site-packages\django\contrib\gis\db\backends\firebird,but when I use it,give me a

error:django.core.exceptions.ImproperlyConfigured: 'firebird' isn't an available database backend.
Try using `django.db.backends.XXX, where XXX is one of:
    'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
Error was: No module named firebird.base

I have already write the path into PYTHONPATH.

How can I get this to work?


回答1:


Use Django 1.3 (or higher) and follow the instructions on the django-firebird page.

Django 1.4 uses the django-firebird driver on github

In your settings.py file, use something similar to this...

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'testdb',
        'USER': 'testdb_user',
        'PASSWORD': 'testdbpassw',
        'HOST': '',
        'PORT': '',
    },
    'fb': {
        'ENGINE': 'firebird',
        'NAME': '/home/idle/mydb.gdb',
        'USER': 'SYSDBA',
        'PASSWORD': 'passw',
        'HOST': '127.0.0.1',
        'PORT': '3050',
        'OPTIONS': {'charset':'WIN1251', 'dialect':1} ,
    }
}



回答2:


I have updated instructions for django 1.4 and ubuntu https://github.com/mariuz/django-firebird/blob/master/README.md

I will clean the readme later and merge it with the master branch

In your case you need to put the firebird dir from the driver in both directories

C:\Python27\Lib\site-packages\django‌​\contrib\gis\db\backends and in C:\Python27\Lib\site-packages

Seems that later it needs the compiler and it loads it from the firebird module Also you will need kinterbasdb http://www.ibphoenix.com/download/connectivity/python



来源:https://stackoverflow.com/questions/11930701/django-firebird-can-not-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!