model.py
class Services(models.Model):
service_image1 = models.ImageField(upload_to='services/thumb/')
service_image = models.ImageField(upload_to='services/')
service_name = models.CharField(max_length=50)
service_desc = RichTextUploadingField(null=True)
def __str__(self):
return self.service_name
def get_absolute_url(self):
return reverse('service-update', kwargs={'id': self.id})
views.py
def service_detail_view(request, id=None, *args, **kwargs):
services = Services.objects.all()
services=get_object_or_404(Services, id=id)
context = {'services': services}
return render(request, 'dental/service_detail.html', context)
services_detail.html
подробно и список оба находятся на одной странице
{% for services in servicess %}
{{ services.service_name }}
{% endfor %}
{{ services.service_image.url }}
{{ services.service_name }}
{{ services.service_desc | safe }}
в моем случае
подробно показан сервис, но список сервисов не показан