Template File Extension
n
A core feature of Jinja is its flexibility regarding template file extensions. Any text file can be loaded as a template, regardless of its extension. You can use .html, .xml, .txt, or any other extension you choose. This allows you to use Jinja to generate a wide variety of text-based formats, from web pages to configuration files, without being constrained by naming conventions.
nn
The `.jinja` Suffix
n
While not required for Jinja to function, adding a .jinja suffix to your templates, such as user.html.jinja, can be a useful practice. This naming convention can make it easier for certain IDEs or editor plugins to recognize the file as a Jinja template and provide syntax highlighting and other helpful features. However, if you use this suffix, you will need to take it into account for things like autoescaping, as the extension is used to determine if a template should be autoescaped.
nn
nn
The Common Project Layout
n
Another common heuristic for identifying templates is to place them within a dedicated templates folder. This is a widely adopted layout for many web development projects, regardless of the file extensions used. This organizational structure makes it easy for developers to find templates and for the application to load them. This approach also helps to logically separate the template files from other static assets and application code.
nn
n
n
