5

I need to design a Django based project with WebSockets on Windows server. It seems like Django Channels is the most elegant and pythonic way to do such thing. However I have issue with finding a proper way to deploy Channels and/or Daphne on Windows. It's suggested to use a process supervisor but all solutions I found so far are on Linux environment.

What is the most proper way to deploy Daphne on Windows? How to actually set it up as Windows service that can scale into multiple threads/processes, listening on the same port. Right now the project (without WebSockets) is deployed on Apache which handles such matters. In case of Daphne I do not know how to make it work that way. Or maybe I should use something else than Daphne to deploy Channels on Windows?

EDIT: I'm using latest version of Channels 2.0.2, Django 1.10 on Python 3.6.

Mirdalan
  • 51
  • 1
  • 5
  • A few things to consider: Are you using channels 2? Does your windows server run python 3? Do you absolutely have to use a Windows server? – Chad Van De Hey Mar 29 '18 at 16:59
  • Thank you for your comment. I've added currently used versions in the project. I'm sorry for not writing it at first. If I could switch to Linux I'd gladly do it, but that's not the case. – Mirdalan Mar 29 '18 at 17:35
  • Realistically, if your windows server is running python 3.6, it can surely run Daphne. Is there anything specific that you are worried/confused about? – Chad Van De Hey Mar 29 '18 at 17:45
  • Well it runs, but I do not really know how should I deploy it in production. How to actually set it up as Windows service that can scale into multiple threads/processes, listening on the same port. Right now the project (without WebSockets) is deployed on Apache which handles such matters. In case of Daphne I do not know how to make it work that way. – Mirdalan Mar 29 '18 at 17:57
  • Ahh... Since I am not a Windows expert, I cannot point you in an exact direction; however, I have set channels up on a production environment using this tutorial (1) that dives through setting up a Daphne worker. You only need to refer to the section that says "Running Daphne Server and a worker process as daemon". This should get you started on the logic of running. Specifically, within the file there is configuration for a "worker". This should give an idea. (1)- https://hackernoon.com/setting-up-django-channels-on-aws-elastic-beanstalk-716fd5a49c4a – Chad Van De Hey Mar 29 '18 at 18:18
  • Did you find a solution? Did deploying on Windows (i assume you used IIS) work? – EB88 Jul 21 '18 at 22:09
  • 1
    Hi, I've changed my workplace lately so didn't have to pursue this matter any further. Sorry, but I didn't find any good solution for that. Now I am happy to develop for Linux platforms :) . – Mirdalan Jul 23 '18 at 07:12

0 Answers0