Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
700 views
in Technique[技术] by (71.8m points)

python - Django channels and azure

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...