Now that we are able to create validated comments using AJAX, let's use the API to retrieve the list of comments and display them beneath the blog entry. To do this, we will read the values from the API and dynamically create DOM elements to display the comments. As you might recall from the earlier API responses we examined, there is quite a bit of private information being returned, including the entire serialized representation of each comment's associated
Entry. For our purposes, this information is redundant and will furthermore waste bandwidth.
Let's begin by doing a bit of additional configuration to our comments endpoint to restrict the
Comment fields we return. In
api.py, make the following addition to the call ...