cancel
Showing results for 
Search instead for 
Did you mean: 

Django 3.2 works with SQL Anywhere

924

Hi all,

I am using Django 3.2 , could I use Django with Sql Anywhere ?

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi all , Thank you very much for your responses.

Using DOS cmd I install the engine for SQL Anywhere 16, running this comand: pip install sqlany-django The engine is installed OK

In Django file settings.py in the variable DATABASES , I copy the definition of my database:

    DATABASES = {
      'default' : {
      'ENGINE': 'sqlany_django',
      'NAME': 'django',
      'USER': 'dba',
      'PASSWORD': 'sql',
      'HOST': 'localhost',
      'PORT': '2644',
      }
    }
And always receive the same error:
File "C:\\Users\\armin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\sqlany_django\\base.py", line 48, in <module> 
Database.register_converter(Database.DT_DECIMAL, util.typecast_decimal) AttributeError: module 'django.db.backends.utils' has no attribute 'typecast_decimal'
What I'm doing wrong, Thanks in advance Armin

VolkerBarth
Contributor
0 Kudos

I don't use Django but from my limited understanding, it seems that Django 2.x dropped/modified that attribute, see here for a similiar Firebird change.

I would suspect that the sqlany-django package would need to be adapted, as well. Hopefully @Graeme is listening...


Of course you could verify that claim with also trying to use Django 1.x which is supported by sqlany-django according to the package docs.