本文介绍了Django频道和Azure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Azure中部署Django频道.

I am trying to deploy django channels in azure.

我已经将其与Azure Redis缓存集成在一起,并且在本地主机上运行良好.

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

我已经尝试过在azure中正常部署django应用程序,除了套接字之外的所有其他东西都可以正常工作.

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.

我遵循了基本的Stater代码来实现Django通道.

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

教程

推荐答案

从您的配置文件中,我看到您使用端口6379.

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

这不起作用,您可以仅使用https端口443和httpazure webapp服务中的端口80 .

如果必须使用自定义端口(例如6379),建议使用服务器并打开安全端口,则webapp将不会部署在Azure上.

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.

这篇关于Django频道和Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 03:24