12345678910111213141516171819202122 |
- from django.shortcuts import render
- from . forms import VoterRegistrationForm
- # Create your views here.
- def index(request):
- voter_registration_form = VoterRegistrationForm()
- if request.method == 'POST':
- voter_registration_form = VoterRegistrationForm(request.POST)
- if voter_registration_form.is_valid():
- print('Valid')
- print(voter_registration_form.cleaned_data)
- else:
- print('Invalid')
- context = {
- 'form': voter_registration_form,
- }
- return render(request, 'vote/index.html', context=context)
|