from django.shortcuts import render

def index(request):
    """
    Render the landing page and handle the admin access request form.
    """
    context = {}
    if request.method == 'POST':
        name = request.POST.get('name')
        email = request.POST.get('email')
        access_code = request.POST.get('access_code')

        # For this first iteration, we'll use a hardcoded secret key.
        # In a real application, this should be stored securely.
        if access_code == 'Xcloud779900':
            context['success'] = True
            context['message'] = f"Success, {name}! Your request has been submitted for approval."
        else:
            context['success'] = False
            context['message'] = "Invalid access code. Please try again."

    return render(request, 'core/index.html', context)