How to configure celery-redis in django project on microsoft azure?

流过昼夜 提交于 2019-12-20 04:09:51

问题


I have this django locator project deployed in azure. My redis cache host name(DNS) is mycompany.azure.microsoft.net. I created it in azure, but not sure where i can find the password for the redis server. I have got this as my configuration in my settings.py. I am using redis as a broker for my celery setup in project.

BROKER_URL = 'redis://:passwordAzureAccessKey=@mycompany.redis.cache.windows.net:6380/0'

I could not connect. Is there anyplace different, I need to put password or username to connect to the above server ? Also where can i find the password in Azure. Or is it due to the fact that I am trying to contact the Azure redis from localhost ?


回答1:


You can find your redis services keys in Azure portal, click Settings=>Access keys, you can select either primary or secondary key as your password in the redis connection string.

And addtionally, you can try to enable the non-ssl endpoint of your redis service, as mentioned at https://azure.microsoft.com/en-us/documentation/articles/cache-python-get-started/#enable-the-non-ssl-endpoint.

It seems that you are using celery, you can use celery cli command to test your redis serivice. E.G.

celery inspect ping -b redis://:{password}@{redis_service_name}.redis.cache.wi ndows.net:6379/0



来源:https://stackoverflow.com/questions/39616701/how-to-configure-celery-redis-in-django-project-on-microsoft-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!