I'm new to this stuff so I apologize if this is in the wrong place. I've inherited a Debian 7.14 system that has Django version 1.8.3 and Python version 2.7.6. It has a connection to SQL Server. We've just upgraded to SQL Server 2016 and are now getting the error
Exception Type: NotImplementedError
Exception Value: Sql Server v13 is not supported.
How can I upgrade to a newer version of Django for this connection to work again? What version will work with SQL Server 2016? I'm thinking it would be a good idea to upgrade Debian version as well while I'm at it, but I'm unsure whether that will break this further.
Any insight or suggestions is greatly appreciated, I've done a ton of research and I'm out of places to turn.
Most likely you're using an outdated version of Django MSSQL database connector. According to its change log, starting with v1.8 the connector support MS SQL Server 2012 and later.
In order to confirm this, check the DATABASES settings of your Django app, and see if it shows 'ENGINE': 'sqlserver_ado' as the connection type. If so,
pip install django-mssql --upgrade should fix your issue (though I haven't actually tested this).
EDIT: OK, so based on additional info from your comment ('ENGINE': 'sql_server.pyodbc' in the DATABASES settings), it looks like you're actually using django-pyodbc-azure as the database connector. This driver seems to be quite Django-version dependent. Let's first find out which version is in use:
pip show django-pyodbc-azure
The version you install should be the same as the Django version. If using Django 1.8, and if the django-pyodbc-azure version shows less than that, try installing the correct version:
pip install "django-pyodbc-azure<1.9"
Related
I am using elasticsearch (version 7.10.2 ) with python (django version 3.0) but I am getting this error
The client noticed that the server is not a supported distribution of Elasticsearch
While searching on the internet I found that downgrading the version of elastic search from 7.14 is was working for a lot of people as version 7.14 was updating a few internal scripts. But in my case the version is already lower than 7.14.
I used curl -X GET "HTTP://localhost:9200" to check its version.
Also, other such issues included NODE, Angular and other frameworks which were not relevant to my case.
How can I solve this issue? If I need to downgrade then which version am I supposed to downgrade?
I managed to make it work with a python client version less than 7, but in my case it was quite an old version of Elasticsearch.
I've solved it with pip install -U 'elasticsearch<7' which installed version 6.8.2.
I'll try and update both Elasticsearch and the python client and get back with more details.
I'm trying to connect my Django app with MySQL and I have Successfully installed MySQL-connector-python-2.0.4 also. But after that whenever I run server same error message is showing.
Here are my cmd ...
Here is the full message showing
you are installing MySQL connector for python (not recommended), you need the MySQLdb module, refer to this official recommendation from django doc https://docs.djangoproject.com/en/3.0/ref/databases/#mysql-db-api-drivers
and install mysqlclient it is a native driver and It’s the recommended choice.
pip install mysqlclient
for further informations have a look at this medium post : https://medium.com/#omaraamir19966/connect-django-with-mysql-database-f946d0f6f9e3
I have been trying to deploy my flask application in a raspbian os environment. The application was running smoothly on ubuntu and postgres 11. On trying to run sqlalchemy migration i encountered error: undefined symbol: PQencryptPasswordConn. I later found out that the missing library was added on postgres 10 and later versions hence missing in versions which were earlier before version 10. I cannot install version 10 or above on raspbian since it is yet to be supported. My only options are installing ubuntu core on my raspberry or find a Flask-SQLalchemy version that works with postgres 9.6. If anyone has been in my situation before or has a better idea your advice will be very much appreciated
I'm new at both Python and Django and still trying to figure out the best environment for my development. As far as I saw, there are 2 options available for establishing a connection to a MSSQL database which are:
Django MSSQL Database Backend: http://django-mssql.readthedocs.org/en/latest/
Django PYODBC: https://github.com/lionheart/django-pyodbc/
What I want to ask is the difference between those 2 options and their pros/cons over each other. Do they differ from each other especially in terms of performance and stability?
(I have only found the link below in stackoverflow but it was quite limited and outdated so I've wanted to ask another question. Sorry if there are any recent ones that I haven't seen yet.)
django-pyodbc vs django-mssql
Thank you.
I chose django-mssql when I started my project two years ago, as it is optimized specially for SQL Server whereas django-pyodbc relies on pyodbc which is a generic ODBC driver.
Of course there are some bugs, but the package is actively maintained. So far it does the job very well for me.
The main downsides :
Only runs on Windows (depends on pywin32 package)
Django version support far behind latest (current stable version supports Django 1.7, and development version is for Django 1.8...)
Migrations are a little buggy. You may have to alter generated sql by yourself in some cases.
django-pyodbc seems to support latest Django version and is cross-platform, however I have not found any positive opinion of people that use it in production back when I had to choose between the two.
After deploying application to Google App Engine this warning is raised on (what it seems like) random requests.
/sqlalchemy/dialects/mysql/base.py:2452: SAWarning: No 'character_set_name' can be detected with this MySQL-Python version; please upgrade to a recent version of MySQL-Python. Assuming latin1.
The sql server is Google Cloud SQL.
Is there a way to fix it (maybe set character_set_name to some value) or it is totally dependent on the MySQL-Python version shipped with App Engine?
I got this issue if I used:
create_engine('mysql+gaerdbms:///xxx?instance=xxx:xxx')
but, it goes away if you use:
create_engine('mysql://root#127.0.0.1:3306/xxx?unix_socket=/cloudsql/xxx:xxx')