django-wiki/django-nyt

MiddleWare

TheSDTM opened this issue · 3 comments

Hello. I inserted this code:
CHANNEL_LAYERS = { "default": { "BACKEND": "asgiref.inmemory.ChannelLayer", "ROUTING": "django_nyt.routing.channel_routing", }, }

But after that "request" variable in my middleware has changed. I can't get request.META['PATH_INFO']. What is wrong?

What happens if you comment it out? Does request.META['PATH_INFO'] show up again?

Yes

It's actually an upstream thing. You can use request.path_info instead, otherwise have a look here:

https://github.com/django/channels/blob/f699d112b0b7c4eebeee6aae85ffdd77e68fbf10/channels/handler.py#L54

If you think it lacks a PATH_INFO key, I suggest you make a PR for django-channels :)