DetailView is the first view where we're going to be interacting with the database. It builds upon TemplateView, and then adds a bunch of functionality based around showing that model instance.
Order of Operation
get- The get method calls
get_object- fetch the object that will be displayed using either the pk or slug passed in through the URL
get_queryset- determine an object list of instances to be able to pick from. This is used when you want to limit the possible options, such as only choosing active articles.
get_template_names- find the template that should be rendered. This method is overridden to give a default template name such as `articles/article_detail.html'. However, if we specify the `template_name` property on the class it will use that template.
get_context_data- put the object into the context data to make it available for use in the template.
get_context_object_name- called within
get_context_datato return the context name to use in the templates. This is why the name of the model, such as article, is available for use in the template.
get_slug_field- if you are filtering the URL by a slug field, this what determines which field to use. In our example we would use the article.title field to filter.