T
T
Tyrion Lannister2016-08-13 00:14:21
Django
Tyrion Lannister, 2016-08-13 00:14:21

Why does Django get a TemplateDoesNotExist error?

In settings.py I specified an absolute link to TEMPLATE_DIRS. Climbs TemplateDoesNotExist, why?
****
TEMPLATE_DIRS = [
'/home/***/venv/project/templates'
]
views.py
from django.shortcuts import render
from django.http.response import HttpResponse
from django.template.loader import get_template
def show_blog( request):
html = get_template('index.html')
return HttpResponse(html)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question