Html file did not work for live streaming in django

In file

class VideoCamera(object):
    def __init__(self): = cv2.VideoCapture(0)
        # Define the codec and create VideoWriter object
    def __del__(self):
    def get_frame(self):
        success, image =
        ret, jpeg = cv2.imencode('.jpg',image)
        return jpeg.tobytes()

**In file **

def gen(camera):

    while True:
        frame = camera.get_frame()
        yield (b'--frame\r\n'
                b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n')

def video_feed(request):
    return StreamingHttpResponse(gen(VideoCamera()),
                    content_type='multipart/x-mixed-replace; boundary=frame')

** My file**

tyurlpatterns = [

And HTML file

{% extends 'blog/base.html' %}
{% block content %}
    <img src="{{ url 'video_feed' }}" alt="video_feed">
{%endblock content%}

here my html file is not work.It just run other file.Html file can't access this url . what i can do for solving this problem?

I expect my every frame continuously pass into my html page.

Back to Top