we need to include topic_id argument in the url for adding new entrybecause the entry must be associated with particular topic here' the urlwhich we add to learning_logs/urls pyurls py --snip-urlpatterns --snip-page for adding new entry url( '^new_entry/(? \ +)/$'views new_entryname='new_entry')this url pattern matches any url with the form : /new_entry/id/where id is number matching the topic id the code (? \ +captures numerical value and stores it in the variable topic_id when url matching this pattern is requesteddjango sends the request and the id of the topic to the new_entry(view function the new_entry(view function the view function for new_entry is much like the function for adding new topicviews py from django shortcuts import render --snip-from models import topic from forms import topicformentryform --snip-def new_entry(requesttopic_id)"""add new entry for particular topic "" topic topic objects get(id=topic_idv if request method !'post'no data submittedcreate blank form form entryform(elsepost data submittedprocess data form entryform(data=request postif form is_valid()new_entry form save(commit=falsenew_entry topic topic new_entry save(return httpresponseredirect(reverse('learning_logs:topic'args=[topic_id])context {'topic'topic'form'formreturn render(request'learning_logs/new_entry html'contextuser accounts