S SmartDocs
Serie: python backend python 6 righe · Aggiornato 2026-02-03

views.py

python_backend/curriculum/django/blog/views.py

from django.shortcuts import render
from .models import Post

def post_list(request):
    posts = Post.objects.all().order_by('-created_at')
    return render(request, 'blog/post_list.html', {'posts': posts})

Articoli correlati