access url_kwargs/request in on_message (django)

25 views
Skip to first unread message

Sebastian Auberger

unread,
Oct 24, 2013, 4:36:04 AM10/24/13
to python...@googlegroups.com
Hello

I am working with django and trying to extend the chat example.

Is it possible to get url_kwargs in the on_message function in my views.py file?
Or is there any request I can fetch?

Cheers


lsbardel

unread,
Oct 24, 2013, 5:34:53 AM10/24/13
to python...@googlegroups.com


On Thursday, October 24, 2013 9:36:04 AM UTC+1, Sebastian Auberger wrote:
Hello

Hi
 
I am working with django and trying to extend the chat example.

Is it possible to get url_kwargs in the on_message function in my views.py file?
Or is there any request I can fetch?
 
I'm not sure what you mean by url_kwargs.
The `websocket.handshake` attribute is the WsgiRequest [1] which handled the handshake and therefore you can use it to obtain all information you need from the wsgi environ.

If by url_kwargs you mean a dictionary representation of the `QUERY_STRING` environ entry, than it can be obtained via `websocket.handshake.url_data` attribute.

Reply all
Reply to author
Forward
0 new messages