Motion JPG images on Django template

Hi, I am trying to implement a solution in django, which is there in Flask. Reference: https://blog.miguelgrinberg.com/post/video-streaming-with-flask ,

This is about streaming JPG images in a sequence and display it on template with time frame rate.
But when I try to implement the same in Django, I am ending with errors. Is there any existing or suggestion to do it in Django

Thanks in advance.