This is how we handle multiple DB Connections with Laravel, which is a PHP Framework not Python (For whom thinks that this is a duplicate post)
<?php
return array(
'default' => 'mysql',
'connections' => array(
# Our primary database connection
'mysql' => array(
'driver' => 'mysql',
'host' => 'host1',
'database' => 'database1',
'username' => 'user1',
'password' => 'pass1'
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
# Our secondary database connection
'mysql2' => array(
'driver' => 'mysql',
'host' => 'host2',
'database' => 'database2',
'username' => 'user2',
'password' => 'pass2'
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
),
);
And this is how you connect to this database.
$user1 = User::on('mysql1')->where(/* ... */)->get()
$user2 = User::on('mysql2')->where(/* ... */)->get()
These are only SELECT queries. Therefore Eloquent works flawlessly.
However, when I want to execute a JOIN query operation between these 2 databases, this seems not possible.