Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!