class Start(models.Model):
number_starts = model.IntegerField
source = models.TextField
class StartForm(forms.ModelForm):
class Meta:
model = Start
def view_start(request):
if request.method == "POST":
form = StartForm(request.POST)
if form.is_valid():
form.save() # записывает данные в базу с формы
else:
# lalala
return render(request, "form.html", {'form': form})
else:
form = StartForm()
return render(request, "form.html", {'form': form})