mirror of
https://github.com/django/daphne.git
synced 2025-06-06 22:23:20 +03:00
Fix generics docs
This commit is contained in:
parent
5e0add6bbb
commit
9618440e6d
|
@ -224,15 +224,15 @@ 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``,
|
the one passed in to your handler as an argument as well as ``self.message``,
|
||||||
as they point to the same instance.
|
as they point to the same instance.
|
||||||
|
|
||||||
And if you just want to use same old django session just use ``http_session`` or
|
And if you just want to use the user from the django session, add ``http_user``:
|
||||||
``http_session_user``::
|
|
||||||
|
|
||||||
class MyConsumer(WebsocketConsumer):
|
class MyConsumer(WebsocketConsumer):
|
||||||
|
|
||||||
http_session_user = True
|
http_user = True
|
||||||
|
|
||||||
|
This will give you ``message.user``, which will be the same as ``request.user``
|
||||||
|
would be on a regular View.
|
||||||
|
|
||||||
That gives you ``message.user`` which is same as ``request.user`` and ``message.http_session``
|
|
||||||
is same as of ``request.session``
|
|
||||||
|
|
||||||
Applying Decorators
|
Applying Decorators
|
||||||
-------------------
|
-------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user