Questions tagged [streaminghttpresponse]
18 questions
14
votes
4 answers
Is it possible to generate PDF with StreamingHttpResponse as it's possible to do so with CSV for large dataset?
I have a large dataset that I have to generate CSV and PDF for. With CSV, I use this guide: https://docs.djangoproject.com/en/3.1/howto/outputting-csv/
import csv
from django.http import StreamingHttpResponse
class Echo:
"""An object that…

good_evening
- 21,085
- 65
- 193
- 298
2
votes
0 answers
Django, calling an event after StreamingHttpResponse is closed
Here is my code:
def stream(self,request: HttpRequest,user,camera_index):
try:
url = self.config["cameras"][int(camera_index)]["url"]
except IndexError or TypeError:
return HttpResponseNotFound()
…

Arda Yılmaz
- 149
- 1
- 9
2
votes
1 answer
How to pass a variable from video view1 (which is inside view2) to view2's template in Django
I have a view home:
def home(request):
return render(request, 'detection/home.html')
And here is its' template templates/detection/home.html:
{% extends "detection/base.html" %}
{% block content %}
Camera View

Sayyor Y
- 1,130
- 2
- 14
- 27
1
vote
1 answer
Problem with Django StreamingHttpResponse
I'm having a problem with Django response class StreamingHttpResponse. When I return a generator as response using StreamingHttpResponse and make a request I excepted to retrieve each data block one by one, instead of that i retrieve the full data…

javier diez
- 13
- 2
1
vote
0 answers
Django StreamingHttpResponse: How to quit Popen process when client disconnects?
In django, i want to convert a m3u8 playlist to mp4 and stream it to the client with ffmpeg pipe. The code works and the ffmpeg process also quits, but only when client waits till the end and received the whole file.
I want to quit the process when…

seriousm4x
- 23
- 4
1
vote
1 answer
SSE DJANGO REQUEST COUNT
i still new using SSE and i have a question about SSE in Django version 3.2.5, i am using StreamingHttpResponse to send SSE response to EventSource client and it does work fine,
my question that
why it takes to long to open the connection between…

Ahmed ELMawrdy
- 21
- 7
1
vote
0 answers
RTSP wrapped with Content-Type: image/jpeg in StreamingHttpResponse
Was trying to wrap RSTP stream in StreamingHttpResponse and same is working completely fine with WSGI server in Django but i need to implement this with ASGI app.
Below code for reference.
In ASGI it continuously loading due to while True loop but…

Keyur Tailor
- 29
- 2
1
vote
0 answers
close connection in `StreamingHttpResponse` and do something after that
I use StreamingHttpResponse in django framework. I want to save some records in database after response finished and connection closed. What should I do?
class foo(View):
def get(self, request):
response =…

mohammad
- 434
- 1
- 5
- 17
0
votes
1 answer
Send StreamingHttpResponse in django channels
Exception inside application: 'StreamingHttpResponse' object has no attribute 'encode'
Traceback (most recent call last):
File "C:\Users\Tamerlan\Desktop\chatbot_project\venv\lib\site-packages\django\contrib\staticfiles\handlers.py", line 101, in…
0
votes
1 answer
How to stream data chunk by chunk in Django using StreamingHttpResponse and receive it in the front end using axios?
I am trying to stream data from my Django backend to my front-end using the StreamingHttpResponse and axios. However, I am encountering an issue where the data is being buffered and only received in the front-end once all the data is ready or when I…

Pourya Delnavaz
- 5
- 7
0
votes
0 answers
Django ASGI/channels with Streaminghttpresponse
I add channels to my project and it's creating a problem,
I have a stream func that streama video with streaminghttpresponse , and that work well before I add asgi/channels to run the server .
I saw that it's some bug that will be fixed in django…

Ilay Asis
- 1
- 1
0
votes
0 answers
streaming data/variables to templete using django
I have a method that returns float variables and I m streaming it to an HTML template using StreamingHttpResponse in Django, to catch the variable I found a way to use XMLHttpRequest in ajax as shown in the code below:
#method to return speed as a…

Aizen-ofc
- 21
- 4
0
votes
1 answer
Live Stream text to HTML tamplets
I have a function at the back-end in Django that calculate and return frames speed of a video given to opencv.videoCapture()`. The type of the speed is float.
class video_feed(object):
def __init__(self, pathVideo):
self.cap =…

Aizen-ofc
- 21
- 4
0
votes
0 answers
Send detecction to client in Real Time and diaply for client not work for me. using Django,React,Yolov5
i'am trying to get the precent of detection in real time,for every moment that is happen and then
send it to client and display it,but it's not work for me.
using django,react and yolov5 for detection.
i'am using this fuction to get the detection in…

Ilay Asis
- 1
- 1
0
votes
0 answers
Problem with Detection in real time using - Yolov5 & Django & React
I am trying to get the percent of detection that showing in the video (when having a detection) that I am Streaming,
to the client and display it on a table for every moment and in the same second that detection happening, but for now I get only a…

Ilay Asis
- 1
- 1