Connecting to MSSQL from django 1.8 on Ubuntu - sql-server

I need to connect to MSSQL database from Django 1.8 and preserve Django 1.8 (not upgrade to newer version od Django).
I installed
pip install django-mssql . ENGINE in settings.py is sqlserver_ado.
It ended with error message
ModuleNotFoundError: No module named pythoncom.
According to this page I see that django-mssql needs PyWin32.
So I returned back to my snapshot in virtual machine and tried it with
pip install django-mssql-backend and changed the ENGINE in settings.py to sql_server.pyodbc
Now I have error message
sql_server.pyodbc isn't an available database backend.
So I returned back to my snapshot in virtual machine and tried it with pip install mssql-django and ENGINE is mssql. This upgraded Django to 3.4.1.
So I returned to my snapshot of virtual machine.
How can I connect to MSSQL from Django 1.8 without upgrading Django? Or is it impossible? Why?
Django 1.8 is running on Ubuntu 18.04

Related

How to move Redash hostservice to my ec2? Migration script is not working

Redash is discontinuing their hosting service app.redash.io/****. I follow this doc to standup an AWS EC2 instance from opensource AMI. First, redash-toolbelt seems installed but can't find redash-migrate. Then I cloned the repo and checked out the issue-5. The recommended migration is not working for this AMI. pip install cannot find peotry.
$ pip3 install peotry
Collecting peotry
Could not find a version that satisfies the requirement peotry (from versions: )
No matching distribution found for peotry
Is there a better way to migrate all my data from Redash site to my EC2? (backup & restore) I do not have CLI access to the Redash hosting site.
I guess you've made a typo. It should be pip install poetry. What you have written is peotry.

import pyodbc, No module name 'pyodbc'

I am pretty new to all this so please bear with me.
I am trying to deploy my code in AWS Elastic-Bean Stalk and my code has pyodbc package to fetch data from the database. The database is deployed on Microsoft Azure and it's connected to the code. After deploying code to Elastic-bean it's showing error
import pyodbc no module name pyodbc
I have checked the requirement.txt file and it has latest version of pyodbc package. I did update all the versions that I have imported. There are students who have done the same process(database on Azure and Code on AWS ElasticBean Stack) and its running fine. My code is running perfectly fine on the local machine.
any leads ???
The install pyodbc may be failing, thus its not getting installed.
The reason is, that on EB for Amazon Linux 2, you need to have gcc-c++ and unixODBC-devel as prerequisites for pyodbc.
Thus in your .ebextentaions you can add a config file .ebextentaions/10_packages.config with the content of:
packages:
yum:
gcc-c++: []
unixODBC-devel: []

Connecting Presto and Apache SuperSet

I have presto and apache superset hosted at GCP Cloud.
Presto server hosted at http://14.22.122.12:8088/ui/
But when i try to connect Presto to Superset it's giving me this error
Could not load database driver: presto
Already installed the presto driver using pip install pyhive.
Not sure what's wrong here ? My SQLAlchemyURL presto://14.22.122.12:8088/catalog_name
This error usually appears when the driver isn't available (so the connection string format isn't recognized).
I would confirm that the pip install happened correctly. If you're running everything within docker, make sure you rebuilt properly. You can enter the docker cli, fire up a Python shell, and try to import the presto driver (you can also try pip freeze in the docker cli).

Laravel SQL Server - PDOException could not find driver on migrate

I have a laravel 5.2 instance configured to run against MS SQL Server. I have downloaded from microsoft the drivers and the connection runs perfect DB::table('usuarios')->select('*')->get(); returns:
[{"id":"5","username":"jtd","password":"$2y$10$t8RXYy\/afaEuIpE8GIk2bOvbHsQoj0fhGPxmo\/3UqJABKVA4I4pHC","email":""}]
But when I try to php artisan migrate i get the:
[PDOException]
could not find driver
Why this is happening?
Stack trace:
c:\wamp\www\presence\webapp>php artisan migrate --verbose
[PDOException]
could not find driver
Exception trace:
() at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\Illuminate\Datab
ase\Connectors\Connector.php:55
PDO->__construct() at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\
Illuminate\Database\Connectors\Connector.php:55
Illuminate\Database\Connectors\Connector->createConnection() at C:\wamp\www\pre
sence\webapp\vendor\laravel\framework\src\Illuminate\Database\Connectors\SqlServ
erConnector.php:32
Illuminate\Database\Connectors\SqlServerConnector->connect() at C:\wamp\www\pre
sence\webapp\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connect
ionFactory.php:61
Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connector
s\{closure}() at n/a:n/a
call_user_func() at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\Il
luminate\Database\Connection.php:924
Illuminate\Database\Connection->getPdo() at C:\wamp\www\presence\webapp\vendor\
laravel\framework\src\Illuminate\Database\Connection.php:792
Illuminate\Database\Connection->reconnectIfMissingConnection() at C:\wamp\www\p
resence\webapp\vendor\laravel\framework\src\Illuminate\Database\Connection.php:6
77
Illuminate\Database\Connection->run() at C:\wamp\www\presence\webapp\vendor\lar
avel\framework\src\Illuminate\Database\Connection.php:349
Illuminate\Database\Connection->select() at C:\wamp\www\presence\webapp\vendor\
laravel\framework\src\Illuminate\Database\Schema\Builder.php:55
Illuminate\Database\Schema\Builder->hasTable() at C:\wamp\www\presence\webapp\v
endor\laravel\framework\src\Illuminate\Database\Migrations\DatabaseMigrationRepo
sitory.php:141
Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists()
at C:\wamp\www\presence\webapp\vendor\laravel\framework\src\Illuminate\Database\
Migrations\Migrator.php:404
Illuminate\Database\Migrations\Migrator->repositoryExists() at C:\wamp\www\pres
ence\webapp\vendor\laravel\framework\src\Illuminate\Database\Console\Migrations\
MigrateCommand.php:103
Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() at C:\
wamp\www\presence\webapp\vendor\laravel\framework\src\Illuminate\Database\Consol
e\Migrations\MigrateCommand.php:58
Illuminate\Database\Console\Migrations\MigrateCommand->fire() at n/a:n/a
call_user_func_array() at C:\wamp\www\presence\webapp\vendor\laravel\framework\
src\Illuminate\Container\Container.php:507
Illuminate\Container\Container->call() at C:\wamp\www\presence\webapp\vendor\la
ravel\framework\src\Illuminate\Console\Command.php:169
Illuminate\Console\Command->execute() at C:\wamp\www\presence\webapp\vendor\sym
fony\console\Command\Command.php:256
Symfony\Component\Console\Command\Command->run() at C:\wamp\www\presence\webapp
\vendor\laravel\framework\src\Illuminate\Console\Command.php:155
Illuminate\Console\Command->run() at C:\wamp\www\presence\webapp\vendor\symfony
\console\Application.php:794
Symfony\Component\Console\Application->doRunCommand() at C:\wamp\www\presence\w
ebapp\vendor\symfony\console\Application.php:186
Symfony\Component\Console\Application->doRun() at C:\wamp\www\presence\webapp\v
endor\symfony\console\Application.php:117
Symfony\Component\Console\Application->run() at C:\wamp\www\presence\webapp\ven
dor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:107
Illuminate\Foundation\Console\Kernel->handle() at C:\wamp\www\presence\webapp\a
rtisan:36
I found a solution. I post it for everyone. I use WAMP stack (PHP, Apache and MySQL). The fact is that wamp uses the 5.5.12 version for terminal CLI, so I have to install SQL Server PDO Extensions on the version I am using and (besides this) on the 5.5.12 version (I have several PHP versions installed). Can provide more information if needed.

Debian Lenny Solr Jetty install + running

I want to setup search for my site. I couldn't find much information to install Jetty + Solr on my linode.
I could install solr-jetty on ubuntu simply using apt-get. any body has better experience with debian?
You shouldn't need to install it through the package manager. Jetty is deployed with Solr from the Solr homepage. So long as you have java installed on your server you can simply unpack the Solr distibution, read example/README.txt

Resources