Connecting Redis to the main service
teunkrol
HOBBYOP

a year ago

Hi,

I have troubles connecting the Redis to the main service. I have the REDIS_URL variable added, but it just looks like the code doesn't read it. Can you please help me? I'm not a really experienced coder.

View Deploy details

15 Replies

a year ago

Please send the code you expect to be reading the env variable


teunkrol
HOBBYOP

a year ago

7498e0e2-09a6-457d-a1f8-b08129b3a3cb


teunkrol
HOBBYOP

a year ago

CHANNELLAYERS = { 'default': { 'BACKEND': 'channelsredis.core.RedisChannelLayer',
'CONFIG': {
'hosts': os.environ.get('REDIS_URL', 'redis://localhost:6379')
,
},
},
}

I've got this in my settings.py

${{ Redis.REDIS_URL }}

and this is the variable that I use


teunkrol
HOBBYOP

a year ago

Is that enough info @Adam?


a year ago

I'm not Adam but no it wouldn't be enough information for him, please provide the full error


teunkrol
HOBBYOP

a year ago

I've added the REDISURL to the service that runs the Django project. Even though Isee REDISURL in the service’s environment variables in the Railway dashboard, the container doesn’t actually receive it at runtime. I've confirmed it with running a debug and that return that there is no connection with the REDISURL. I would like to get some help why the REDISURL variable isn't passed into the container at runtime.


a year ago

screenshot of your service variables with everything still hidden please


teunkrol
HOBBYOP

a year ago

1331060483767406800


a year ago

show the debug log now please


teunkrol
HOBBYOP

a year ago

It returns REDIS_URL = None at the bottom

1331060770275856400


a year ago

are you using a Dockerfile


teunkrol
HOBBYOP

a year ago

yes


a year ago

please see these docs -


teunkrol
HOBBYOP

a year ago

1331060961834045700


teunkrol
HOBBYOP

a year ago

alright


Loading...