It works now thank you for all of your help;
class homeView(View):
def get(self, request):
data = recipemeal.objects.all().order_by("-id")
context ={
"recipes":data,
"form":RecipeForm()
}
return render(request, "index.html", context)
def post(self, request):
form = RecipeForm(request.POST)
if form.is_valid():
form.save()
return redirect("home")
data = recipemeal.objects.all().order_by("-id")
context = {
"recipes": data,
"form": form
}
return render(request, "index.html", context)