I've some image files that are in the 'img' folder in the static directory of django app. I want to access them all and store into a list in my 'views.py' so that I can iterate through them to display them by rendering them through the template. How can that be done? How to access static files in django views?
Asked
Active
Viewed 122 times
1
-
Where are you having problems? Do you know how to list the files in a directory? – Daniel Roseman Aug 16 '18 at 15:35
-
I am not sure how exactly to do this, but [this answer](https://stackoverflow.com/a/58713009/5985115) could maybe help you. – Jeroen van der Merwe May 20 '20 at 09:51