PyCharm
 
Get PyCharm
You are viewing the documentation for an earlier version of PyCharm.

Add Django templates

Last modified: 01 April 2022

Professional feature: download PyCharm Professional to try.

PyCharm makes it possible to create and render templates written in one of the supported template languages:

It is important to note that one can edit templates without actually installing the template languages. However, in order to create or render templates, and navigate between views and templates, the corresponding template language should be properly installed.

Before making use of a certain template language, configure it in the Template Languages page of the Settings dialog and ensure that file types of any existing templates are properly recognized.

When creating a Django application, you can immediately specify a folder where templates will be stored.

You can make Django support skip some folders (disable Django language substitution), if you mark them as resources.

PyCharm allows placing breakpoints to the lines of Django template files, at the lines with Django tags or expressions. If you want to trace back exceptions that are raised in course of template debugging, open Breakpoints dialog,  and in the Django Exception Breakpoints tab, select the checkbox Suspend. Debugging Jinja templates is not supported.