Anonymous user
Make a website with Django: Difference between revisions
→3. Complete Part 3 of the tutorial
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>:
<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 ===
|