title: Learning Django, but confused with variables
body: <p>I am going through the Django Tutorial and i am on step 3 of creating polls app. There is a variable called "question_id" and i cant understand where exactly this is defined or where its coming from. I will post the files bellow. My only guess is that this variable is somehow created by Django internally when class Question is defined in Models.py, but i am not sure. Its not defined in "Question" class. </p>
  
  <p>Here are my files:</p>
  
  <p>views.py</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse
  from django.template import loader
  
  from .models import Question
  
  
  def index(request):
      latest_question_list = Question.objects.order_by('-pub_date')[:5]
      context = {'latest_question_list': latest_question_list}
      return render(request, 'polls/index.html', context)
  
  
  #def index(request):
  #    return HttpResponse("Hello, world. You're at the polls index.")
  
  def detail(request, question_id):
      return HttpResponse("You're looking at question %s." % question_id)
  
  def results(request, question_id):
      response = "Your looking at result of question %s."
      return HttpResponse(response % question_id)
  
  def vote(reqeust, question_id):
      return HttpResponse("You're voting on question %s." % question_id)
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>from django.conf.urls import url
  
  from . import views
  
  urlpatterns = [
      #ex: /polls/
      url(r'^$', views.index, name='index'),
      #ex: /polls/5
      url(r'^(?P&lt;question_id&gt;[0-9]+/$)', views.detail, name='detail'),
      #ex: /polls/5/result/
      url(r'^(?P&lt;question_id&gt;[0-9]+/results/$)', views.results, name='results'),
      #ex: /polls/5/vote
      url(r'^(?P&lt;question_id&gt;[0-9]+/vote/$)', views.vote, name='vote'),
  ]
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>import datetime
  
  from django.db import models
  from django.utils import timezone
  
  
  class Question(models.Model):
      question_text = models.CharField(max_length=200)
      pub_date = models.DateTimeField('date published')
  
      def __str__(self):
          return self.question_text
  
      def was_published_recently(self):
          return self.pub_date &gt;= timezone.now() - datetime.timedelta(days=1)
  
  
  
  class Choice(models.Model):
      question = models.ForeignKey(Question, on_delete=models.CASCADE)
      choice_text = models.CharField(max_length=200)
      votes = models.IntegerField(default=0)
  
      def __str__(self):
          return self.choice_text
  </code></pre>
  
  <p>Thank you for your help,
  Nermin</p>