Search code examples
pythondjangodjango-channels

How to Access URL Params in Django Channels Consumers


If i had the following url in routing.py:

/rooms/<int:id>/

How would I access the id parameter from withing a JSONWebsocketConsumer?


Solution

  • this.scope['url_path']['kwargs']['id']