User Authenticated in Gunicorn and Daphne

51 views
Skip to first unread message

dario.h...@gmail.com

unread,
Jul 24, 2018, 4:08:30 PM7/24/18
to Django users
Hi there,

ideally I would like to run Daphne alongside Gunicorn and not Daphne alone:

- My chat with Daphne 
- Rest of the website with Gunicorn

A user logs in - request via Gunicorn. Now when he connects with the chat I get an AnonymousUser using self.scope['user']. This is a problem because I would like to assign him to the right ChatRoom.
If I run all requests through Daphne everything works fine.

Also I am using Nginx, don't know if it matters, just gonna leave it here.

How could I fix this? What would be the workaround?

Let me know if you need any code/files.

Best Regards,

Dario

Andrew Godwin

unread,
Jul 27, 2018, 6:26:46 PM7/27/18
to django...@googlegroups.com
You can configure Nginx to route to different backends based on path - put your Nginx proxy_pass settings inside a "location" block.


Andrew

--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
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/cb2a7475-69dd-4a09-ba32-ea89950d5fc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages