mirror of
https://github.com/Rushilwiz/relish.git
synced 2025-04-09 14:30:19 -04:00
21 lines
458 B
Python
21 lines
458 B
Python
from django.shortcuts import render
|
|
from .forms import ResponseForm
|
|
|
|
# Create your views here.
|
|
def index(request):
|
|
success = False
|
|
|
|
if request.method == 'POST':
|
|
form = ResponseForm(request.POST)
|
|
if form.is_valid():
|
|
form.save()
|
|
success = True
|
|
else:
|
|
form = ResponseForm()
|
|
|
|
context = {
|
|
'form': form,
|
|
'success': success,
|
|
}
|
|
|
|
return render(request, 'form/index.html', context) |