Error 111 connecting to localhost:6379. Connection refused. Django Heroku

后端 未结 12 1165
感动是毒
感动是毒 2020-12-28 12:33

I am able to run redis locally and everything works.

However when I deploy to heroku I get this error:

Error 111 connecting to localhost:6379. Conn         


        
12条回答
  •  旧时难觅i
    2020-12-28 13:06

    If you are using django_rq, a configuration like this will work for you:

    RQ_QUEUES = {
        'default': {
             'HOST': 'localhost',
             'PORT': '6379',
             'URL': os.getenv('REDISTOGO_URL', 'redis://localhost:6379'),  # If you're
             'DB': 0,
             'DEFAULT_TIMEOUT': 480,
         }
    }
    

    It will make that work on your local environment and also on Heroku!

提交回复
热议问题