Connecting Redis to the main service
teunkrol
HOBBYOP

2 years 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

Closed

15 Replies

2 years ago

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


teunkrol
HOBBYOP

2 years ago

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


teunkrol
HOBBYOP

2 years ago

CHANNEL_LAYERS = {

'default': {

'BACKEND': 'channels_redis.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

2 years ago

Is that enough info @Adam?


2 years ago

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


teunkrol
HOBBYOP

2 years ago

I've added the REDIS_URL to the service that runs the Django project. Even though Isee REDIS_URL 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 REDIS_URL. I would like to get some help why the REDIS_URL variable isn't passed into the container at runtime.


2 years ago

screenshot of your service variables with everything still hidden please


teunkrol
HOBBYOP

2 years ago

1331060483767406753


2 years ago

show the debug log now please


teunkrol
HOBBYOP

2 years ago

It returns REDIS_URL = None at the bottom

1331060770275856404


2 years ago

are you using a Dockerfile


teunkrol
HOBBYOP

2 years ago

yes


2 years ago

please see these docs -


teunkrol
HOBBYOP

2 years ago

1331060961834045573


teunkrol
HOBBYOP

2 years ago

alright


Welcome!

Sign in to your Railway account to join the conversation.

Loading...