Add Premium feature with UI, model changes, and admin configuration

This commit is contained in:
mrtoine 2025-12-11 09:38:00 +01:00
parent 95111240bc
commit abe4a1a965
7 changed files with 156 additions and 6 deletions

View file

@ -1,6 +1,11 @@
from django.shortcuts import render
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})