'Upload webscrapped images from folder to database Django

I'm webscrapping data about ski resorts from a site, also getting some pictures. I am saving those pictures in a folder and after that i'm getting them in SQLite database through an imageField. The bad part is that they don't work

directory = r'C:\Users\tiberiu.ghimbas\Documents\Resorts img5'
image_list = [cv2.imread(file) for file in 
glob.glob(r'C:/Users/tiberiu.ghimbas/Documents/Resorts img5/*.png')]

This list is then looped and insertet item by item.

I'm doing all the correct settings for handling images and media files. I know that by going the classic way of uploading images through a form will get you in the database the path to the image from de media/"upload_to = 'filename'" folder but going by my way i'm getting only them image name. How can i solve that ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source