django-cid icon indicating copy to clipboard operation
django-cid copied to clipboard

Support for django-channels

Open aqeelat opened this issue 4 years ago • 2 comments

Hi,

When I follow the tutorial for setting up the library, I noticed this sequence of events when I run the app:

  1. The reloader is loaded. With it, a cid is generated and included in the log.
  2. When a request is made, the library gets and returns the correct cid to the caller.
  3. At the end of the request lifecycle, channel prints the access log, a new cid is generated and included in the log.
  4. When another request is made, the library, again, gets and returns the correct cid to the caller.
  5. At the end of the request lifecycle, the same cid as in step 3 is used in the log. This same cid is used in all subsequent access logs.

Channels log definition: https://github.com/django/channels/blob/main/channels/management/commands/runserver.py#L142 Helpful PR: https://github.com/django/channels/pull/693/files The line that generates the response in channels: https://github.com/django/channels/blob/main/channels/http.py#L256

aqeelat avatar Oct 26 '21 18:10 aqeelat

Hello,

I am not familiar with Django Channels. Would you have some code example that exhibits this problem?

dbaty avatar Oct 27 '21 04:10 dbaty

I created this sample project to show the issue: https://github.com/AqeelAT/django_channels_project

run the app and go to localhost:8000/api/hello/hello/

aqeelat avatar Oct 27 '21 09:10 aqeelat