Hi,
You're right - a lot of the information only appears in the first "connect"
message. If you want to persist it, you can use a channel session:
http://channels.readthedocs.io/en/stable/getting-started.html#persisting-data

This will let you save information (such as the token, or even a User
object) into the session in the connect consumer, and then let you use it
in other consumers that have the same decorator.

Andrew


On Wed, Feb 1, 2017 at 5:34 AM, Sgiath <[email protected]> wrote:

> Hi,
> I am trying to use the query_string parameter and I want to ask what is
> the correct way how to use it.
> I am using JsonWebsocketConsumer and when debugging I noticed that on the
> Handshake the message content contains path, headers, query_string, client,
> server, reply_channel and order.
> But every other message contains just reply_channel, path, order and text
> .
> How should I correctly use it? Specifically I want authenticate user based
> on the query_string (I send token in it) I can do that in connection
> phase but what should I do next? On every other message the user is
> AnnonymousUser because there is no query_string. Should I save
> query_string into channel_session? Should I save user into channel_session
> ?
> BTW I cannot use user from http session because I am connecting to WS from
> the mobile app.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/a30535e3-29e1-4547-af70-0e391d1b80d3%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a30535e3-29e1-4547-af70-0e391d1b80d3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1uqLaM6NJ1HiGwZA2b0jt_CxHah%3DO6HSk6dCfqyz_-Qsog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to