I am making a polls application in django and I get the following error:
TemplateDoesNotExist at /polls/
This is what my index function looks like this:
def index(request):
latest_questions = Question.objects.order_by('-pub_date')[0:5]
context = {'latest_questions': latest_questions}
return render(request, "polls/template.html", context)
template.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% if latest_ques %}
<ul>
{% for question in latest_ques%}
<li><a href = '/polls/{{question_id}}/'><b>
{{question.ques_text}}</b></a></li>
{% endfor %}
</ul>
{% endif %}
</body>
</html>
Inside of my polls file I have a template file and inside of that I have a template folder inside of that I have another polls folder and inside of that I have template.html.
I have tried using render_to_response instead of render, I also tried to add the path to DIRS in settings.py and I tried taking request out of the function. Thank you so much.