Flask Sqlalchemy that works with postgres 9.6 - python

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

Related

The client noticed that the server is not a supported distribution of Elasticsearch?

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.

Django Python Version 3.6.10 to 3.6.11 Heroku

I have a Django application deployed in Heroku, it has been deployed for months without any issue. Deployments today are suddenly failing saying Heroku doesn't support Python 3.6.10, only 3.6.11 (closest one to 3.6.10)
I have not specified a version anywhere in my app so I can only assume Django defaults to 3.6.10 or Heroku previously did, but they have abruptly stopped supporting it now.
Are there any risks in setting 3.6.11 in my runtime file so my builds work? Is there any reason it defaults to 3.6.10?
The app is in use heavily and Heroku support is awful unless you pay 1000 a month so I can't afford it to fail, and if it does, I can't revert to 3.6.10!
Thanks so much for any help
The Heroku docs say your app continues to use the same Python version as when it was first deployed. In your case, the default would have been 3.6.10 when you first deployed your app, and this is no longer available. You can explicitly upgrade to 3.6.11 by creating a runtime.txt file.
It should be safe to upgrade between Python 3.6.X versions. If you want to be sure, then you could deploy a separate app on Python 3.6.11, or create a virtualenv locally and test on Python 3.6.11.
I can only assume Django defaults to 3.6.10
Django isn't controlling the Python version that Heroku is using. Each version of Django supports a range of Python versions. Check the release notes for your version.

Django Version 1.8.3 SQL Server v13 is not supported

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"

python.exe the fastcgi process exited unexpectedly

i have some reasons witch i am stuck to use django on windows machine. i was wondering how to configure django on a windows sesrver 2012 r2 with iis 8.5. so i followed the tutorial here.
i did what the tutorial says and it is pretty much straight forward what i am gonna do for any kind of application i want to run with iis.
but i get the following error the fastcgi process exited unexpectedly.
here is what i have provided as executable for wfastcgi module:
E:\venvs\...\Scripts\python.exe|E:\venvs\...\Lib\site-packages\wfastcgi.py
i removed the wfastcgi.py part after | from handler mapping and error changed to script processor could not find the config for fastcgi configuration and i figured out the error must be related to the wfastcgi.py file. but i could not find the issue here. so i was wondering what can be the issue? and what are my options are here.
has any one been able to use django on a windows machine?? jsut in case my python version is python 3.6
I had the exact same problem as you but managed to solve this by using Python 3.4.2 version. Follow the exact steps as described in this tutorial Django with IIS and avoid using Python 3.5 or above because it seems that there are compatibility issues. The stack I used was IIS version 10, Windows 10, Python 3.4.2 and Django 1.11.2.
Upgrading wfastcgi to the latest version
pip install wfastcgi --upgrade
solved it for me: Python 3.6.6, wfastcgi 3.0.0
In my Case I was facing the same issue i.e. enter image description here
Mine is a Django App used for APIs that queries data from back-end platforms. This issue was only for specific filters that the API was using in queries while for other values in filters it worked great.
My Config file did not have a fastCgi tag and I added below mentioned part to top of system.webServer in config file. Yes off course it gave few errors here and there corresponding to activityTimeout and requestTimeout. Tried increasing up-to 900 and 601 respectively and then it worked for me. But could not understand cause of the issue as query that API was running for which i was facing this issue was not taking that long at all. I would like to understand that.
<fastCgi>
<application fullPath="D:\Python34\python.exe|D:\Python34\Scripts\wfastcgi.py"
arguments=""
maxInstances="4"
idleTimeout="300"
activityTimeout="900"
requestTimeout="601"
instanceMaxRequests="10000"
protocol="NamedPipe"
flushNamedPipe="false">
</application>
</fastCgi>

How to connect to remote MS SQL Server from python using py(py)odbc

I have a remote ms sql server at office location and I wanted to connect from an ubuntu desktop to it. I installed DBeaver http://dbeaver.jkiss.org/ and it was working like a charm without any other dependency.
After this I started to setup a connection from python with no success until I found a straightforward tutorial at https://tryolabs.com/blog/2012/06/25/connecting-sql-server-database-python-under-ubuntu/. But this solution involved installing some packages to ubuntu itself and configuring some related config files in the system.
The question is if there is some python package to use without os dependencies?
I don't think you would be able to achieve what you want without installing some packages. Reason being you are connecting to the MSSQL which follows a different set of rules as it is from Microsoft.
If you were connecting to any DB (MySQL,MongoDB etc) you still need to install a package or module to make it work.
Try to install the package as described in the tutorial from the like you shared and if you run into any problem paste the problem here.

Categories