From b740838b13330a2eea7db428490d73fdc76c0c71 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 29 Sep 2020 11:08:16 +0200 Subject: [PATCH] submit leads to the done() view now --- input/templates/input/project.html | 2 +- input/urls.py | 1 + input/views.py | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/input/templates/input/project.html b/input/templates/input/project.html index 5e91cfb..cbc5f08 100644 --- a/input/templates/input/project.html +++ b/input/templates/input/project.html @@ -1,4 +1,4 @@ -
+ {% csrf_token %} {{ formset }} diff --git a/input/urls.py b/input/urls.py index 88a9cac..0f97b12 100644 --- a/input/urls.py +++ b/input/urls.py @@ -4,4 +4,5 @@ from . import views urlpatterns = [ path('', views.index, name='index'), + path('saved', views.done, name='done') ] diff --git a/input/views.py b/input/views.py index 2adc2c0..7dda7bf 100644 --- a/input/views.py +++ b/input/views.py @@ -1,8 +1,7 @@ from django.shortcuts import render from django.forms import modelformset_factory from .models import Project -# Create your views here. -# from django.http import HttpResponse +from django.http import HttpResponse def index(request): @@ -16,3 +15,6 @@ def index(request): else: formset = ProjectFormSet() return render(request, 'input/project.html', {'formset': formset}) + +def done(request): + return HttpResponse("Your data is save now.")