django3 crud mysql -bootstrap
https://www.techiediaries.com/django/django-3-tutorial-and-crud-example-with-mysql-and-bootstrap/
def edit(request, pk, template_name='crudapp/edit.html'):
contact = get_object_or_404(Contact, pk=pk)
form = ContactForm(request.POST or None, instance=post) # instance=contact
if form.is_valid():
form.save()
return redirect('index')
return render(request, template_name, {'form':form})
ความคิดเห็น
แสดงความคิดเห็น