title: Unable to cv2.imwrite in django static folder from django views
body: <p>I am unable to save the image in <code>static</code> but can save in the same rekognition directory. How do I save a snapshot from camera to static folder? </p>
  
  <p>My OpenCV code is running in post method of <code>views.py</code>.</p>
  
  <p>In <code>views.py</code>:</p>
  
  <pre><code>cap = cv2.VideoCapture(0)
  ret, img = cap.read()  # Read the image from webcam
  cv2.imwrite('static/video_snapshot.jpg', img)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yue4a.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yue4a.jpg" alt="Tree of the directory"></a>  </p>