Connect to Sybase database from Django

Viewed 249

I tried to connect to Sybase database from Django using sqlanydjango, but I have stuck. One answer saying that

sqlany-django is no longer maintained; it was last updated in May 2016.

What is the other possibility to connect to Sybase database?

OS Ubuntu 18.04

django 2.2.4

3 Answers

Sybase is no longer maintained and it's not supported by Django. I recommend using one of the supported databases:

  • PostgreSQL
  • MariaDB
  • MySQL
  • Oracle
  • SQLite

Personally, I would recommend using PostgreSQL - I think it's the most advanced database. If you use it, I would recommend using version 13, since version 14 is still new and I think it's not officially supported by Django yet. It's always a good practice to use the previous major release. Also with Django, I recommend upgrading to the latest major release only about 4 to 6 months after its initial release. So for today, this means using Django 3.2 (latest minor release, currently 3.2.11).

You can use django-environ to define the database you are using in settings.

You could use the freetds module. GitHub repository was active 5 days ago, it aims to provide support for sybase and MSQL Server.

I used it with MSQL

You can download it from there, and installing with the instruction on this link (Sybase python module website)

Then you can test your installation using these steps

You can also try different Django version.

If this doesn't show anything wrong, and Django still won't connect to your DB, you can try to edit Django's source files so the ImproperlyConfigured exception doesn't raise (REALLY REALLY RISKY, DO A BACK UP OF YOUR DB) or migrate your Sybase to a supported database.

Related