views.py 616 B

123456789101112131415161718192021
  1. from django.http import HttpResponseRedirect
  2. from django.shortcuts import render
  3. from .forms import CreateEventForm
  4. def index(request):
  5. return render(request, 'zitap/index.html')
  6. def about(request):
  7. return render(request, 'zitap/about.html')
  8. def create_event(request):
  9. if request.method == 'POST':
  10. form = CreateEventForm(request.POST)
  11. if form.is_valid():
  12. data = form.cleaned_data
  13. print(data)
  14. #return HttpResponseRedirect('/edit-event')
  15. else:
  16. form = CreateEventForm()
  17. return render(request, 'zitap/create-event.html', {'form': form})