#23000: Wrong path when refereing to the index.html template
-----------------------------------+--------------------
Reporter: maximo.martinez@… | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+--------------------
When updating the view in order to reference the newly created template.
Loader is asked to load 'polls/index.html'. However, it throws an
exception. Since it's looking for it in the projects folder. It's supposed
to be 'index.html'.
{{{
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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.b2bcafe77e38f40a6785a61a0cee307c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.