from django.db import models
class news(models.Model):
image = models.ImageField(upload_to='static/img', blank=True)
def __str__(self):
return self.title #Его тут нет, т.к. я часть кода обрезал
{% for posts in object_list %}
...
{% if image %}
<img src="{{posts.image.url}}" class="img">
{% endif %}
...
{% endfor %}