privateping icon indicating copy to clipboard operation
privateping copied to clipboard

REDIS_URL declaration

Open venzen opened this issue 10 months ago • 1 comments

I notice in 'settings/production.py' that channels config refers to a variable REDIS_URL. Where is this defined in the code? If I should define it myself then what is the format string?

Some advice on setting the DATABASE_URL variable will also be appreciated. I'm not using Heroku

venzen avatar Mar 14 '25 11:03 venzen

Hi @venzen channels config is picked by django channels from settings. Read more about it from the documentation.

The value of REDIS_URL is defined in environment variables for the security purposes. format string is redis://user:password@host:port

For the database, we're using postgres, thus the url string format will be postgres://username:password@host:5432/db_name

Alternatively, you can remove dj_database_url and use default database format provided by django.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'db_name',                      
        'USER': 'db_user',
        'PASSWORD': 'db_password',
        'HOST': 'host',
        'PORT': 5432,
    }
}

princekhunt avatar Mar 19 '25 07:03 princekhunt