From 9618440e6dd04eeef2532ab5a4a43b8258d9fce9 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 11 Sep 2016 11:00:45 +0100 Subject: [PATCH] Fix generics docs --- docs/generics.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/generics.rst b/docs/generics.rst index 7ec272f..96d4d87 100644 --- a/docs/generics.rst +++ b/docs/generics.rst @@ -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``, 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``:: +And if you just want to use the user from the django session, add ``http_user``: 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 -------------------