the url pattern for the topic page is little different than the other url patterns we've seen so far because it will use the topic' id attribute to indicate which topic was requested for exampleif the user wants to see the detail page for the topic chesswhere the id is the url will be localhost: /topics/ here' pattern to match this urlwhich goes in learning_logs/urls pyurls py --snip-urlpatterns --snip-detail page for single topic url( '^topics/(? \ +)/$'views topicname='topic')let' examine the regular expression in this url patternr'^topics(? \ +)/$the tells django to interpret the string as raw stringand the expression is contained in quotes the second part of the expression/(? \ +)/matches an integer between two forward slashes and stores the integer value in an argument called topic_id the parentheses surrounding this part of the expression captures the value stored in the urlthe ? part stores the matched value in topic_idand the expression \dmatches any number of digits that appear between the forward slashes when django finds url that matches this patternit calls the view function topic(with the value stored in topic_id as an argument we'll use the value of topic_id to get the correct topic inside the function the topic view the topic(function needs to get the topic and all associated entries from the databaseas shown hereviews py --snip- def topic(requesttopic_id)"""show single topic and all its entries "" topic topic objects get(id=topic_idw entries topic entry_set order_by('-date_added' context {'topic'topic'entries'entriesy return render(request'learning_logs/topic html'contextthis is the first view function that requires parameter other than the request object the function accepts the value captured by the expression (? \ +and stores it in topic_id at we use get(to retrieve the topicjust as we did in the django shell at we get the entries associated with this topicand we order them according to date_addedthe minus sign in front of date_added sorts the results in reverse orderwhich will display the most recent entries first we store the topic and entries in the context dictionary and send context to the template topic html