#Help regarding Python and Redis connection

7 messages · Page 1 of 1 (latest)

neon fossil
#

I have a flask application that uses Redis for caching. I am getting the following error:
redis.exceptions.AuthenticationError: Authentication required.
I have also added the environment variables REDISHOST and REDISPORT and connecting to it by the following:

redis_client = redis.Redis(
    host=os.environ.get("REDISHOST"), port=os.environ.get("REDISPORT")
)```

The application is open source and here's the app.py file: https://github.com/hemanth-kotagiri/sgpa-rest-api/blob/master/app.py

I tried looking up redis documentation page in docs.railway.app but it doesn't provide a way to connect to it. Please help me out! Thanks in advance!
GitHub

A RESTful API for getting results from various JNTUH servers. - sgpa-rest-api/app.py at master · hemanth-kotagiri/sgpa-rest-api

#

Fixed it!

#

used the railway cli to create a localshell env and tested out with other url env variable and it works.

steep lark
#

@neon fossil how to create local shell env

neon fossil
#

Just do 'railway shell'

neon fossil
#

@steep lark

steep lark
#

So just type railway shell and run the command right ? @neon fossil