def post(self, request): form = BasicForm(request.POST) if not form.is_valid(): ctx = {'form': form} return render(request, 'form/form.html', ctx) # save data return redirect('/form/success')
def post(self, request): form = BasicForm(request.POST) if not form.is_valid(): ctx = {'form': form} return render(request, 'form/form.html', ctx) # If there are no errors, we would save the data x = reverse('form:success') return redirect(x)
def post(self, request): form = BasicForm(request.POST) if not form.is_valid(): ctx = {'form': form} return render(request, 'form/form.html', ctx) # Save the Data # Look up the url for the next view in urls.py x = reverse('form:success') return redirect(x)
def post(self, request) : form = BasicForm(request.POST) if not form.is_valid() : ctx = {'form' : form} return render(request, 'form.html', ctx) js = json.dumps(request.POST, sort_keys=True, indent=4) ctx = {'title': 'request.POST', 'dump': js} return render(request, 'formdump.html', ctx)