the url for the page needs to pass the id of the entry to be edited here' learning_logs/urls pyurls py --snip-urlpatterns --snip-page for editing an entry url( '^edit_entry/(? \ +)/$'views edit_entryname='edit_entry')the id passed in the url (for exampleedit_entry/ /is stored in the parameter entry_id the url pattern sends requests that match this format to the view function edit_entry(the edit_entry(view function when the edit_entry page receives get requestedit_entry(will return form for editing the entry when the page receives post request with revised entry textit will save the modified text into the databaseviews py from django shortcuts import render --snip-from models import topicentry from forms import topicformentryform --snip-def edit_entry(requestentry_id)"""edit an existing entry "" entry entry objects get(id=entry_idtopic entry topic if request method !'post'initial requestpre-fill form with the current entry form entryform(instance=entryelsepost data submittedprocess data form entryform(instance=entrydata=request postif form is_valid()form save(return httpresponseredirect(reverse('learning_logs:topic'args=[topic id])context {'entry'entry'topic'topic'form'formreturn render(request'learning_logs/edit_entry html'contextwe first need to import the entry model at we get the entry object that the user wants to edit and the topic associated with this entry in the if blockwhich runs for get requestwe make an instance of entryform with