Django context variable names for the templates
<p>EDIT:
I know I can change the names of the variables. My question is in the case that I don't want to do that. I want to know what are all the variables that django generates automatically.</p>

<hr>

<p>I'm doing Django's getting started tutorial and I'm on the <a href="https://docs.djangoproject.com/en/1.10/intro/tutorial04/" rel="nofollow">generic views section</a> where at one point it explains:</p>

<blockquote>
  <p>In previous parts of the tutorial, the templates have been provided
  with a context that contains the question and latest_question_list
  context variables. For DetailView the question variable is provided
  automatically â since weâre using a Django model (Question), Django is
  able to determine an appropriate name for the context variable.
  However, for ListView, the automatically generated context variable is
  question_list.</p>
</blockquote>

<p>My problem is that I don't know how Django determines this "appropriate names". I want to know this for when I write my own template. I would want to know what context variable names to use in such template.</p>

<p>From what I can understand, if my model is <code>Question</code>, the <code>question</code> context variable would store that question, and the <code>question_list</code> context variable would store every question.</p>

<p>So my doubt is: What other context variables names can I use? and what would they store? I can't seem to find this on the documentation, please redirect me to it if you know where it is.</p>

<p>I think this default context variable name only applies when dealing with Django's Class Based Views.</p>

<p>E.g. If you are using a DetailView for a Animal model, Django will auto create a context variable called 'animal' for you to use in template. I think it also allows the use of 'object'. </p>

<p>Another example is, as you mentioned, the ListView for a Animal model which would generate context name called animal_list. </p>

<p>However, in both of these cases, there are ways to change the default context variable name. If you specify 'context_object_name' in your DetailView, this will be the name you refer to in your template. This will also work for ListViews.</p>

<p>This website has all info on CBVs of all Django versions:</p>

<p><a href="https://ccbv.co.uk/projects/Django/1.9/django.views.generic.detail/DetailView/" rel="nofollow">https://ccbv.co.uk/projects/Django/1.9/django.views.generic.detail/DetailView/</a></p>

python django django-templates django-class-based-views