Django channels on IIS

1,158 views
Skip to first unread message

Алексей Кузуб

unread,
Jan 25, 2017, 9:38:01 AM1/25/17
to Django users
I have a project in Django and i want to use django channels for support websockets in my project, but i have a problem with IIS configuration. Could somebody helps me with configuration daphne in IIS or configuration IIS to support channels and daphne. Has somebody any expierence in it? And maybe somebody knows some ways to deploy django+channels on IIS with or without daphne?
Sorry for my bad english.

Andrew Godwin

unread,
Jan 25, 2017, 12:25:51 PM1/25/17
to django...@googlegroups.com
Hi,

I am afraid I don't have experience using IIS - I don't know if it even supports HTTP/1.1 proxying, which is needed for WebSockets. Hopefully someone else can help.

Andrew

On Wed, Jan 25, 2017 at 6:35 AM, Алексей Кузуб <roni...@gmail.com> wrote:
I have a project in Django and i want to use django channels for support websockets in my project, but i have a problem with IIS configuration. Could somebody helps me with configuration daphne in IIS or configuration IIS to support channels and daphne. Has somebody any expierence in it? And maybe somebody knows some ways to deploy django+channels on IIS with or without daphne?
Sorry for my bad english.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9364bca2-2a03-4ae7-b93b-ff105ff34d31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jani Tiainen

unread,
Jan 25, 2017, 1:14:22 PM1/25/17
to django...@googlegroups.com
There exists 3rd party ASGI handler for IIS: https://github.com/mjkillough/iis-asgi-handler/ 

It also requires at least IIS 8 and websocket protocol installed. More details at https://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support

Note, you need to build that handler yourself, which then requires another set of tools, visual studio 2015 and CMake 2.8+

Also note that there is not much of installation instructions or how to build package that you can just install to your server without installing all the development tools there.

I really suggest that you try to find some *nix platform to run required parts, it's just plain simpler and more documented than IIS.


For more options, visit https://groups.google.com/d/optout.



--
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

Алексей Кузуб

unread,
Jan 26, 2017, 2:55:25 AM1/26/17
to Django users
Thank you for your answers and advices. I have no possibility to use *nix platform, my employer wants it on IIS. I'll try to build it, thank you very much!

среда, 25 января 2017 г., 21:14:22 UTC+3 пользователь Jani Tiainen написал:
There exists 3rd party ASGI handler for IIS: https://github.com/mjkillough/iis-asgi-handler/ 

It also requires at least IIS 8 and websocket protocol installed. More details at https://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support

Note, you need to build that handler yourself, which then requires another set of tools, visual studio 2015 and CMake 2.8+

Also note that there is not much of installation instructions or how to build package that you can just install to your server without installing all the development tools there.

I really suggest that you try to find some *nix platform to run required parts, it's just plain simpler and more documented than IIS.
On Wed, Jan 25, 2017 at 7:25 PM, Andrew Godwin <and...@aeracode.org> wrote:
Hi,

I am afraid I don't have experience using IIS - I don't know if it even supports HTTP/1.1 proxying, which is needed for WebSockets. Hopefully someone else can help.

Andrew
On Wed, Jan 25, 2017 at 6:35 AM, Алексей Кузуб <roni...@gmail.com> wrote:
I have a project in Django and i want to use django channels for support websockets in my project, but i have a problem with IIS configuration. Could somebody helps me with configuration daphne in IIS or configuration IIS to support channels and daphne. Has somebody any expierence in it? And maybe somebody knows some ways to deploy django+channels on IIS with or without daphne?
Sorry for my bad english.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Avraham Serour

unread,
Jan 26, 2017, 6:59:37 AM1/26/17
to django-users
if you are stuck on windows but not necessarily IIS you may try cygwin, I once had to deploy on windows and after investigating some possibilities I just installed cygwin and put nginx with uwsgi.

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Алексей Кузуб

unread,
Jan 27, 2017, 1:33:13 AM1/27/17
to Django users
Thank you! Maybe i'll try it. One more question...can i use daphne by https?

четверг, 26 января 2017 г., 14:59:37 UTC+3 пользователь Avraham Serour написал:

Sgiath

unread,
Jan 27, 2017, 2:27:52 AM1/27/17
to Django users
Yes you can.
daphne -e ssl:443:privateKey=key.pem:certKey=crt.pem django_project.asgi:channel_layer

For more info look at the Daphne GitHub repo https://github.com/django/daphne/

But I would suggest run Nginx in front of the Daphne which will handle SSL.

Алексей Кузуб

unread,
Jan 27, 2017, 2:52:01 AM1/27/17
to Django users
I have IIS, and i ran IIS in front of Daphne which handle SSL. But when i run daphne to listen port which support https in IIS, daphne tell me 
"2017-01-27 10:19:37,082 CRITICAL Unhandled error in Deferred:
2017-01-27 10:19:37,082 CRITICAL
Traceback (most recent call last):
  File "c:\python35\lib\site-packages\twisted\internet\tcp.py", line 981, in startListening
    skt.bind(addr)
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access pe
rmissions

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python35\lib\site-packages\twisted\internet\defer.py", line 121, in execute
    result = callable(*args, **kw)
  File "c:\python35\lib\site-packages\twisted\internet\posixbase.py", line 478, in listenTCP
    p.startListening()
  File "c:\python35\lib\site-packages\twisted\internet\tcp.py", line 983, in startListening
    raise CannotListenError(self.interface, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on 0.0.0.0:1001: [WinError 10013] An attem
pt was made to access a socket in a way forbidden by its access permissions."
I tried different ports, which allowed in firewall. What i am doing wrong?
пятница, 27 января 2017 г., 10:27:52 UTC+3 пользователь Sgiath написал:

Jani Tiainen

unread,
Jan 27, 2017, 3:15:48 AM1/27/17
to django...@googlegroups.com

Hi,

Most probably accesses to ports below 1024 requires that you start daphne from administrator elevated prompt.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.

-- 
Jani Tiainen

Алексей Кузуб

unread,
Jan 27, 2017, 3:27:06 AM1/27/17
to Django users
Port 8081 - same problem. I run it with administrator permissions.

пятница, 27 января 2017 г., 11:15:48 UTC+3 пользователь Jani Tiainen написал:

Daniel Butler

unread,
May 23, 2019, 10:04:26 PM5/23/19
to Django users
First off I love this project. Django Channels is amazing!

I just wanted to see if anyone has had any success with using iis with Django-Channels since this post over 2 years ago.

Thank you!

Aldian Fazrihady

unread,
May 23, 2019, 10:09:30 PM5/23/19
to django...@googlegroups.com
IIS still exists? 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Daniel Butler

unread,
May 23, 2019, 11:27:24 PM5/23/19
to django...@googlegroups.com
Unfortunately


For more options, visit https://groups.google.com/d/optout.
--
Daniel Butler

Daniel Butler

unread,
May 24, 2019, 1:17:36 AM5/24/19
to Django users
It looks like I found my key I had to install the application module CGI then use this library to get everything to work! 

Roger Gammans

unread,
May 24, 2019, 4:32:54 AM5/24/19
to django...@googlegroups.com
On Thu, 2019-05-23 at 22:17 -0700, Daniel Butler wrote:
It looks like I found my key I had to install the application module CGI then use this library to get everything to work! 


Does that support websockets? 

IIS itself seems to ( https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support ) , but I don't the factcgi ->wsgi adaptor does.

I've used it for non-channels projects, but didn't think it would support websockets; and channels - for a start it's WSGI not ASGI.

Or have I missed something.

Daniel Butler

unread,
Jun 15, 2019, 9:35:21 AM6/15/19
to Django users
No you haven’t missed anything I spoke too soon. I was able to get the regular site running using fastcgi. I hope to revisit this once the regular site is in production. It’s too bad we are on Windows server R2

Daniel Butler

unread,
Jun 15, 2019, 1:33:29 PM6/15/19
to Django users
My plan to get this to work is to have daphine handle websockets and iis normal http. I don’t know how to configure iis to allow that though. Any ideas or direction would be much appreciated

On Sat, Jun 15, 2019 at 9:36 AM Daniel Butler <dabut...@gmail.com> wrote:
No you haven’t missed anything I spoke too soon. I was able to get the regular site running using fastcgi. I hope to revisit this once the regular site is in production. It’s too bad we are on Windows server R2

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/O-VoFGoQHbs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.
--
Daniel Butler
Reply all
Reply to author
Forward
0 new messages