Django channels and azure

柔情痞子 提交于 2021-02-10 07:33:42

问题


I am trying to deploy django channels in azure.

I have already integrated it with azure redis cache and it's working good in local host.

I have tried the normal deployment of django apps in azure, everything except sockets are working.

CHANNEL_LAYERS = {
'default': {
    'BACKEND': 'channels_redis.core.RedisChannelLayer',
    'CONFIG': {
        "hosts": [(f'redis://:{os.environ["REDISPASS"]}@mywebsite.redis.cache.windows.net:6379/0')],
    },
},

}

It's showing unexpected error website closed unexpectedly.

I have followed this basic stater code for implementing django channels.

Tutorial


回答1:


From your config file, I saw you use port 6379.

This doesn't work, you can only use https port 443 and http port 80 in the azure webapp service.

If you must use a custom port such as 6379, it is recommended to use a server and open a secure port, then the webapp will not be deployed on azure.



来源:https://stackoverflow.com/questions/62861435/django-channels-and-azure

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