What is the best location to put templates in django project?

django, django-project-architect, django-templates, python, templates

Solution

From the Django book, chapter 4:

If you can’t think of an obvious place to put your templates, we recommend creating a templates directory within your Django project (i.e., within the mysite directory you created in Chapter 2, if you’ve been following along with our examples).

This is exactly what I do, and has worked great for me.

My directory structure looks something like this:

`/media` for all my CSS/JS/images etc `/templates` for my templates `/projectname` for the main project code (i.e. the Python code)

Problem

What is the best location to put templates in django project?

Original source

Related problems