# OpenCV with Flask or Django

**URL:** <https://forum.opencv.org/t/opencv-with-flask-or-django/2291>\
**Category:** Python\
**Created:** [March 22, 2021, 6:40am UTC](https://forum.opencv.org/t/opencv-with-flask-or-django/2291 "2021-03-22T06:40:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliasLichaa](https://avatars.discourse-cdn.com/v4/letter/e/ee7513/32.png) [@EliasLichaa](https://forum.opencv.org/u/EliasLichaa)\
**Post date:** [March 22, 2021, 6:40am UTC](https://forum.opencv.org/t/opencv-with-flask-or-django/2291/1 "2021-03-22T06:40:58Z")

</div>

Hello guys,  
I want to know how to render a frame on the website using Flask or Django,  
because I want to add event listeners on a frame with OpenCV waitkey and setmousecallback but using Flask or Django  
if someone can help me with that, the only thing I can do at the moment is to convert the matrix image to an actual image.jpeg and render it on the web, if someone can help me please on this

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [March 22, 2021, 7:40am UTC](https://forum.opencv.org/t/opencv-with-flask-or-django/2291/2 "2021-03-22T07:40:43Z")

</div>

think of it, you cannot use opencv’s gui (imshow, event handlers,waitKey, etc) on a webserver, you have to write your own UI in html/js

---

<div class="post-metadata">

**Author:** ![EliasLichaa](https://avatars.discourse-cdn.com/v4/letter/e/ee7513/32.png) [@EliasLichaa](https://forum.opencv.org/u/EliasLichaa)\
**Post date:** [March 22, 2021, 7:51am UTC](https://forum.opencv.org/t/opencv-with-flask-or-django/2291/3 "2021-03-22T07:51:19Z")

</div>

Thank you for your comment, can you recommend a solution for this? if I don’t want to make a server request each time an event exist?  
you think using react node, and implementing opencv.js is better?
