sessions and users doc updated (#354)

This commit is contained in:
Naveen Yadav 2016-09-11 15:28:06 +05:30 committed by Andrew Godwin
parent b46c511b13
commit 5e0add6bbb

View File

@ -224,6 +224,16 @@ This will run the appropriate decorator around your handler methods, and provide
the one passed in to your handler as an argument as well as ``self.message``,
as they point to the same instance.
And if you just want to use same old django session just use ``http_session`` or
``http_session_user``::
class MyConsumer(WebsocketConsumer):
http_session_user = True
That gives you ``message.user`` which is same as ``request.user`` and ``message.http_session``
is same as of ``request.session``
Applying Decorators
-------------------