Vladislav Kozlenko <vladisla...@softwareplanet.uk.com> added the comment:

It will be not easy as I'll need to create some sandbox for you. The current 
code version is not available for sharing.


But ok. For example here is a routing.py file:

from django.conf.urls import url
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator
from channels.auth import AuthMiddlewareStack
from some_dir import MyConsumer

application = ProtocolTypeRouter({
    'websocket': AllowedHostsOriginValidator(
        AuthMiddlewareStack(
            URLRouter([
                url('api/socket/end-point-1', MyConsumer),
            ])
        )
    )
})

Let me know if you need more information

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44577>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to