Can you add a note regarding django_view?
- Vorherrschende Sprache
- Python
- Sterne
- 50
- Forks
- 3
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I recently used django-wsgi to integrate some existing WSGI based code into one of my projects.
For the most part using django_view to call the WSGI app worked out well, but I noticed in certain situations I wouldn't get a response body. Ultimately the problem was discovered to be certain middleware applications examine HTTPResponse.content, which in turn would result in the iterator created in django_view being exhausted. The end result was a HTTPResponse without content.
From what I know about WSGI, which isn't much, using iterators/generators in the response is perfectly acceptable. In this case care must be taking to ensure that the response isn't iterated until it's going to be sent to the client, otherwise you could end up with a partial or empty response body.
I worked around it by doing a cheesy response.content = response.content since I don't have huge amounts of data involved.
I don't consider it a bug technically, but having a note/warning might prevent someone else from going crazy in the future. =)
Thanks,
Chad
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.