it doesn't work, I tried( [06/Mar/2020 15:01:39] "GET /products/ HTTP/1.1" 200 1719 Not Found: /products/3.png [06/Mar/2020 15:01:39] "GET /products/3.png HTTP/1.1" 404 2137
On Friday, March 6, 2020 at 2:35:52 PM UTC+3, Omkar Parab wrote: > > {{ product.image.url }} > > On Fri, Mar 6, 2020, 4:50 PM Aly_34_04 MR_34_04 <allaberdi...@gmail.com > <javascript:>> wrote: > >> [image: Capture.JPG] >> Enter code here... >> #django templates >> >> {% extends 'base.html' %} >> {% block content %} >> <h1>Products</h1> >> <div class="row"> >> {% for product in products %} >> <div class="col"> >> <div class="card" style="width: 18rem;"> >> <img src="{{product.image}}.jpg" class="card-img-top" alt="..."> >> <div class="card-body"> >> <h5 class="card-title">{{product.name}}</h5> >> <p class="card-text">$ {{product.price}}</p> >> <a href="#" class="btn btn-primary">add to card</a> >> </div> >> </div> >> </div> >> {% endfor %} >> </div> >> {% endblock %}... >> >> >> #python code >> >> class Product(models.Model): >> name = models.CharField(max_length=50) >> price = models.FloatField() >> image = models.FileField() >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/a9354269-5866-4332-9acb-a0b558501d0d%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/a9354269-5866-4332-9acb-a0b558501d0d%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/509b5541-dfbb-43a8-a3b9-5e4c56807fbe%40googlegroups.com.