I was following a django tutorial online (Mike Hibbert's) and at tutuorial 4 he completed the basic articles app and at one point he goes to the url with the extension '/articles/all', all of his objects show up, wheres as when i try it, only the first one appears... its works perfectly when i try to get each object individually with the extension /article/get/<1, 2, 3>...
articles.html:
<html>
<body>
<h1> Articles </h1>
{% for article in articles %}
<div>
<h2><a href="/article.get/{{ article.id }}/">{{ article.title }}</a></h2>
<p>{{article.body}}</p>
</div>
{% endfor %}
</body>
</html>
article.html:
<html>
<body>
<h1> {{ article.title }} </h1>
<p> {{article.body}} </p>
</body>
</html?
articles/views.py:
def articles(request):
return render_to_response('articles.html',
{'articles' : Article.objects.all() })
def article(request, article_id=1):
return render_to_response('article.html',
{'article' : Article.objects.get(id=article_id) })
articles/urls.py:
urlpatterns = patterns('',
url(r'^all/$', 'article.views.article'),
url(r'^get/(?P<article_id>\d+)/$', 'article.views.article'),