import os
import platform

from django import get_version as django_version
from django.shortcuts import render, redirect
from django.views.generic import TemplateView
from .forms import TicketForm

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

def ticket_success(request):
    return render(request, 'core/ticket_success.html')

