So, now that django officially supports Jinja 2 as a templating engine, I hoped enabling it would be as simple as switching a line in config. But when I do that, jinja fails to find my templates.
My understanding is I could manually configure a list of directories for it to look for templates in, but I would like it to behave exactly like DTL behaves by default. (ie. look in the /templates directory). Basically, my app is structured the way it is suggested in the official tutorial, and I would like to use jinja without changing anything else. Is it possible?
Here's how my setings.py file looks now:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'APP_DIRS': True,
},
]
The error I get is TemplateDoesNotExist at /
and here is my directory structure:
mysite
mysite
myapp
templates
myapp
index.html
manage.py
please note that I am hoping not to use any external modules.
edit: as requested, here's the code calling the template:
def index(request):
return render(request, 'myapp/index.html')