from django.shortcuts import render, get_object_or_404
from courses.models import Course 

def home(request):
    courses = Course.objects.order_by('-created_at')[:6]
    return render(request, 'home.html', {'courses': courses}) 

def premium(request, course_id):
    """Landing page présentant les avantages du Premium."""
    course = get_object_or_404(Course, pk=course_id)
    return render(request, 'premium.html', {'course': course})
