Files
Voting/apps/charts/views.py
Victor Alexandrovich Tsyrenschikov 42ed1b04cb Django
2025-11-21 00:02:57 +05:00

14 lines
341 B
Python

from django.shortcuts import render
from django.core import serializers
from apps.pages.models import *
# Create your views here.
def index(request):
products = serializers.serialize('json', Product.objects.all())
context = {
'segment': 'charts',
'products': products
}
return render(request, 'charts/index.html', context)