Re: Problem with displaying media files

2025-01-08 Thread Ewa Adamus
Hi, You’re right, the problem was with passing data to the template in my view. It is working now!!! Thank you very much I should send you my best honey! Best regards to you Ewa > On 8 Jan 2025, at 17:51, RANGA BHARATH JINKA wrote: > > Hi, > > The issue is with how you're passing the m

Re: Problem with displaying media files

2025-01-08 Thread RANGA BHARATH JINKA
Hi, The issue is with how you're passing the mymiody data to the template. In your view, you are using: mymiody = Miody.objects.all().values() The .values() method returns dictionaries instead of model instances, which means you lose the ability to call .url on the ImageField. Solution: Change

Problem with displaying media files

2025-01-08 Thread Szawunia
Hi, I completely stuck with displaying media files - 'ImageField' in my html. Static files are displayed ok. I've read the 'whole internet' that topic and still nothing. I'm working on mac OS Sonoma, Django 5.1.3, Python 3.11. My Html: My model: miody_foto = models.ImageField(upload_to = 'miod