Thursday, April 27, 2017

please im new to django.Need help understanding small code of django poll app.Highlighted with ******************

polls/views.py
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]      template = loader.get_template('polls/index.html')
  ************please Explain me this part specially ('latest_question_list'= latest_question_list) ******** context = {          'latest_question_list': latest_question_list,      }
    return HttpResponse(template.render(context, request))

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/68a91c29-bac0-4189-8923-d46f3bc1ef87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment