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
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.
You can use pyodbc.
To install this.
Pip install pyodbc
import pyodbc
cnxn = pyodbc.connect(‘DRIVER={Devart ODBC Driver for ASE};Server=myserver;Port=myport;Database=mydatabase;User ID=myuserid;Password=mypassword;String Types=Unicode’)
For reference:-
https://medium.com/#sharma.jayant1992/best-way-to-connect-python-with-sybase-database-76445713efaf
Related
Im a beginner to django.
Someone help to connect Oracle 11g db with django 2.0 in windows. What is the requirements and how to connect and what are the changes to be done.
According to the manual,
Django supports Oracle Database Server versions 12.1 and higher. Version 5.2 or higher of the cx_Oracle Python driver is required.
You may run in to trouble with version 11g -- but if you want to give it a shot, that link has the instructions.
Tell me, how to install Drupal 8.1.9 or 8.2.0 with PostgreSQL? Interestingly, in earlier versions, when the installation was attended by a selection of PostgreSQL. In newer versions this is even no mention
Alternative database engines such as SQLite and PostgreSQL are still available in Drupal 8. However, only the available engines are shown.
If you install the correct PDO module for your PHP environment (e.g. php70-pdo-pgsql) you should have that engine available to you:
You can also use phpinfo() to tell if PostgreSQL support is correctly enabled. You will find the following statement there if it is:
PDO Driver for PostgreSQL => enabled
remove the commented code extension=pdo_pgsql from php.ini file and then start the setup you will see the postgreSQL database option
How can I setup a Django 1.5.1 app running with Python 3.3 to access a MySQL database? I tried using MySQLdb but apparently it doesn't support Python 3.3.
My next intention was to use Connector/Python, but what am I supposed to put for the "Engine" key of the Databases dictionary of the settings.py file?
If someone could provide detailed steps of how to get Django to work with Connector/Python, that would be great!
MySQLdb is the Python interface to MySQL [supported by django]. Version 1.2.1p2 or later is required for full MySQL support in Django.
At the time of writing, the latest release of MySQLdb (1.2.4) doesn’t support Python 3. In order to use MySQL under Python 3, you’ll have to install an unofficial fork, such as MySQL-for-Python-3.
This port is still in alpha. In particular, it doesn’t support binary data, making it impossible to use django.db.models.BinaryField.
Basically your only options to avoid Alpha quality drivers are:
Don't use python 3.
Don't use MySQL.
Hopefully this makes the choice easier: http://grimoire.ca/mysql/choose-something-else
REF: https://docs.djangoproject.com/en/dev/ref/databases/#python-3
I have created a new virtual environment so that I can update my code from django1.3 to django1.4. The django1.3 environment has no issues with the sqlite version and database I am using. The Django1.4 version gives me a error of:
DISTINCT ON fields is not supported by this database backend
I am not finding any information on changes to the new version that might cause this. Does anyone know why it might work fine in 1.3 and not 1.4?
Has anyone experience in using Django with the Drizzle database?
The first GA version of Drizzle has just been released and from my understanding it should be be a good match for Django. Being a stripped down version of MySQL it still provides all the needed functionality and hopefully a better performance.
To use the Django MySQL backend, you have to install the MySQLdb driver. When I install MySQLdb on a machine that has Drizzle installed (but not MySQL), I get this error: EnvironmentError: mysql_config not found. I believe this is the step where MySQLdb is looking for compiler options to build the client. We probably need a fork of the Django MySQL backend that uses a Python wrapper around libdrizzle.
MySQLdb is playing just fine with Drizzle. We use it to work with SQLAlchemy.
I can't speak to the issues you encountered, but I also tend to have both MySQL and Drizzle on my machines. Things built ok for me, but I'd be happy to help resolve any issues anyone else is having