jrief / django-angular

Let AngularJS play well with Django
http://django-angular.awesto.com/
MIT License
1.23k stars 294 forks source link

Incompatibility with channels #291

Closed anachronic closed 7 years ago

anachronic commented 7 years ago

I'm trying to run both channels and django-angular in a project of mine, and I found this exception while doing it

Traceback (most recent call last):
  File "/home/nsalas/.virtualenvs/calce/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/nsalas/.virtualenvs/calce/lib/python3.6/site-packages/django/utils/deprecation.py", line 138, in __call__
    response = self.process_request(request)
  File "/home/nsalas/.virtualenvs/calce/lib/python3.6/site-packages/djng/middleware.py", line 62, in process_request
    request.environ['PATH_INFO'] = url
AttributeError: 'AsgiRequest' object has no attribute 'environ'

The AsgiRequest comes from channels, I'm pretty sure. This was tested with any combination of these

Also, I'm not sure, but this could also be an issue with channels, I don't know.

I'd be happy to contribute with some guidelines of what to do.

jrief commented 7 years ago

I never tested with channels. At that time, channels did not exist, hence I wrote django-websocket-redis. You presumably have to read the migration plan, and check how to replace WSGIRequest against AsgiRequest.