Make a website with Django: Difference between revisions

imported>Jesstess
imported>Jesstess
Line 52:
* Please visit https://docs.djangoproject.com/en/1.4/intro/tutorial03/ and complete part 3 of the tutorial.
 
<b>Check your understanding</b>: WhatWhich doesof the following URL fragments matches this pattern from a sample <code>apiurls.GetSearchpy</code> return?
<pre>r'^polls/(?P<poll_id>\d+)/results/$'</pre>
 
* polls/ABC/results/
* polls/12345/results/
* polls//results/
 
<b>Check your understanding</b>: What is the purpose of <code>t.render</code> in this code snippet?
 
<pre>def index(request):
latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
t = loader.get_template('polls/index.html')
c = Context({
'latest_poll_list': latest_poll_list,
})
return HttpResponse(t.render(c))</pre>
 
=== 4. Complete Part 4 of the tutorial ===
Anonymous user