sqlanywhere / sqlanydb

Python driver for SAP Sybase SQL Anywhere
Other
43 stars 20 forks source link

Error was: cannot import name BaseDatabaseClient #4

Closed dkdndes closed 9 years ago

dkdndes commented 9 years ago

goblin:dbanywhere $ source dbanwhere17/.../sa_config.sh

goblin:dbanywhere $ python manage.py migrate

[...]
django.core.exceptions.ImproperlyConfigured: 'sqlany_django' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    u'base', u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: cannot import name BaseDatabaseClient

goblin:dbanywhere $ more test_sqlany.py

  import sqlanydb
  conn = sqlanydb.connect(uid='dba', pwd='sql123', eng='django', dbn='django')
  curs = conn.cursor()
  curs.execute("select 'Hello, world!'")
  print "SQL Anywhere says: %s" % curs.fetchone()
  curs.close()
  conn.close()

goblin:dbanywhere $ python test_sqlany.py

  SQL Anywhere says: Hello, world!

I use Django 1.8.5, the test file works just fine. Please, advice.

dkdndes commented 9 years ago

Hi,

just saw in sqlany-django the following comment:

gperrow-SAP commented 2 days ago
Django 1.8.x is not supported by the SQL Anywhere driver. I will investigate adding support.

If I uninstall django 1.8.2 and install django 1.7 the configuration generates a different error:

   File     "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
 __import__(name)
ImportError: No module named security

I use a plain empty django project and have not added any modules, yet.

gperrow-SAP commented 9 years ago

I'm afraid I don't know what the problem is. Can you post the entire error message so we can tell who's trying to load the security module? There is no security module in the sqlany-django driver, nor do we try to import one.

If this is a problem with the sqlany-django driver, you should post the issue in that project: https://github.com/sqlanywhere/sqlany-django

dkdndes commented 9 years ago

I opened a new issue in the other repository and close this one. Please, have a look at #9