def addreceta(request): if request.method == "POST": form = RecetaForm(request.POST) if form.is_valid(): receta = form.save() receta.save() return HttpResponseRedirect("/") else: form = RecetaForm() return render(request, 'recetas/add_receta.html', {'form': form})
def addreceta(request): if request.method == "POST": form = RecetaForm(request.POST) if form.is_valid(): receta = form.save() receta.save() return HttpResponseRedirect("/") else: form = RecetaForm() return render(request, 'recetas/add_receta.html', {'form': form})