from django.shortcuts import render
from .models import Event

def home(request):
    """Render the landing screen with a list of published events."""
    events = Event.objects.filter(is_published=True).order_by('start_date')
    context = {
        'events': events,
    }
    return render(request, "core/index.html", context)
