{{{
from django.http import HttpResponse
from django.template import RequestContext, loader
from polls.models import Poll
def index(request):
latest_poll_list = Poll.objects.order_by('-pub_date')[:5]
template = loader.get_template('polls/index.html')
context = RequestContext(request, {
'latest_poll_list': latest_poll_list,
})
return HttpResponse(template.render(context))
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23000>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
If you follow the instructions about the location of the new template,
there is no problem.
"Within the templates directory you have just created, create another
directory called polls, and within that create a file called index.html.
In other words, your template should be at
polls/templates/polls/index.html."
--
Ticket URL: <https://code.djangoproject.com/ticket/23000#comment:1>