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

238
Vistas
How to setup redis as cache with flask-session when working with containers?

I'm trying to deploy a flaskapp with docker, so I have two containers, one for my flaskapp and another for redis. I've setup a network and executed both within it. When accessing my flaskapp the following error occurs:

ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address.

This is happening because I'm using redis as cache for flask-session and I'm hosting redis at a container called exampleredis.

My question is: how can I setup redis host to be exampleredis in Flask?

I have the following config file:

class DevConfig(Config):
    REDIS_HOST = 'exampleredis'
    SESSION_TYPE = 'redis'
    JSONIFY_PRETTYPRINT_REGULAR = False
    JSON_SORT_KEYS = False
    BCRYPT_LOG_ROUNDS = 15
    DEBUG = True
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

According to the document of flask-session, this should probably work:

import redis

class DevConfig(Config):
    SESSION_REDIS = redis.from_url('redis://exampleredis:6379')
    SESSION_TYPE = 'redis'
    ...
over 4 years ago · Santiago Trujillo Denunciar
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