Is there a python native way to connect django to a database through an ssh tunnel? I have seen people using ssh port forwarding in the host machine but I would prefer a solution that can be easily containerized. Answer It is pretty seamless. Requirements: The sshtunnel package https://github.com/pahaz/sshtunnel In the django settings.py create an ssh tunnel before the django
Tag: ssh-tunnel
How to create a SSH tunnel using Python and Paramiko?
I need to create tunneling to read information from a database. I use Paramiko, but I have not worked with tunneling yet. Please provide an example of a simple code that creates and closes a tunnel. Answer At work we usually create ssh tunnels forwarding ports. The way we do that is, by using the standard command ssh -L port:addr:port