def myname(request): if request.method == 'POST': form = MyNameForm(request.POST) if form.is_valid(): return HttpResponseRedirect('/forms/') else: form = MyNameForm() return render(request, 'forms/forms.html', {'form': form})
def my_name(request): title = 'Работа с формами' if request.method == 'POST': form = MyNameForm(request.POST) if form.is_valid(): return HttpResponseRedirect('/forms/tranks/') else: form = MyNameForm() return render(request, 'forms.html', {'title': title, 'form': form})
def my_name(request): if request.method == 'POST': form = MyNameForm(request.POST) if form.is_valid(): return render(request, 'tranks.html', {'form': form}) else: form = MyNameForm() return render(request, './forms.html', {'form': form})