Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

616
Vistas
Flask running in WSL2 cannot connect to postgres running on windows (did work with WSL1)

I have started to develop a Flask app using VSCode/WSL1 and have then migrated from WSL1 to WSL2.

Since then, I cannot connect to my the database running on windows using "localhost"

DATABASE_URI = 'postgresql://sysadmin:mypassword@localhost/db_dev'

I can only connect if use the ip address found in "cat /etc/resolv.conf"

DATABASE_URI = 'postgresql://sysadmin:mypassword@172.31.96.1:5432/db_dev'

But that IP address changes on every reboot, so that is not convenient at all. It looks like networking has changed quite a bit between WSL and WSL2, but I cannot find an acceptable solution to this I would say rather basic issue.

There are no problems with my Postgres config, as I can connect using the ip address.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda