Re: Streaming images with HttpResponse?

2013-11-18 Thread Brian Schott
What are you trying to do?  Typical approach would be to use Javascript to pull the images.  Take a look at dajaxice.   — Sent from Mailbox for iPhone On Mon, Nov 18, 2013 at 1:57 PM, Alex Karargyris wrote: > So thanks to Simon I was able to make this work. Here is the

Re: Streaming images with HttpResponse?

2013-11-18 Thread Alex Karargyris
So thanks to Simon I was able to make this work. Here is the code for those who might be interested: yield "" yield '' yield "\n" rval, frame = settings.CAP.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imwrite('media/image.jpeg', gray,

Re: Streaming images with HttpResponse?

2013-11-18 Thread Alex Karargyris
Dear all, Thank you for the help. I managed to setup StreamingHttpResponse to read the images from the media folder. However I believe that there is a syntax error with html code . It doesn't display the image. Any help? I am attaching the code below.Thanks in advance! def

Re: Streaming images with HttpResponse?

2013-11-15 Thread Javier Guerra Giraldez
On Fri, Nov 15, 2013 at 12:08 PM, Jorge Cardoso Leitão wrote: > I believe that is not possible with Django views. Views are made for > request-response, i.e. the client sends a request, the view returns a > response, and that's it, end of connection. i think the WSGI

Re: Streaming images with HttpResponse?

2013-11-15 Thread Jorge Cardoso Leitão
I Alex. I believe that is not possible with Django views. Views are made for request-response, i.e. the client sends a request, the view returns a response, and that's it, end of connection. In your case, the server has a stream of data that you want to constantly send to the client. This sounds

Streaming images with HttpResponse?

2013-11-15 Thread Alex Karargyris
I have this simple app that I opens webcam and processes the frames using OpenCV. In my views.py I have the following code: def processImage(): while True: rval, frame = settings.CAP.read() //Read frames from webcam gray = cv2.cvtColor(frame,