from django.shortcuts import render
from .forms import WhitelistForm

def index(request):
    if request.method == 'POST':
        form = WhitelistForm(request.POST)
        if form.is_valid():
            form.save()
            return render(request, 'core/index.html', {'success': True, 'form': WhitelistForm()})
    else:
        form = WhitelistForm()
    return render(request, 'core/index.html', {'form': form})