How to configure Apache to run ASGI in Django Channels? Is Apache even required?

后端 未结 2 1684
你的背包
你的背包 2020-12-23 23:37

I built a django-project and deployed it to production using Apache-WSGI combo. For that I had added the apache2.conf as shown below:

WSGIS         


        
2条回答
  •  甜味超标
    2020-12-24 00:14

    As mentioned by Lukasa, I stopped the Apache server, which at first stopped my django app getting delivered out to the world. Then I ran the following commands:

    sudo daphne MyProject.asgi:channel_layer --port 80 --bind 0.0.0.0 -v2
    sudo python manage.py runworker -v2
    

    The two commands started delivering the app to http requests from outside the server. No other configurations were required other than mentioned in the question post.

提交回复
热议问题