I've just installed PyCharm, and have opened an existing project with multiple apps. When I open django templates, they are highlighted as if plain HTML, i.e. {% block %}
elements and {{variable}}
references are not treated specially.
Is there any way I can force it to use the django template syntax highlighter for these files? Or am I doing something wrong?
The project is configured as a django project.
To override these templates, you will need to have an admin folder in your templates folder. If you do not have a templates folder, you can create it in the main project folder. To do so, you will have to change the project's settings.py . Find the TEMPLATES section and modify accordingly.
Configure a template language for a projectOpen the Settings/Preferences dialog, and click the node Python Template Languages. In the Template Languages page, do the following: From the Template language list, select the specific template language to be used in project.
Django TemplateDoesNotExist error means simply that the framework can't find the template file. To use the template-loading API, you'll need to tell the framework where you store your templates. The place to do this is in your settings file ( settings.py ) by TEMPLATE_DIRS setting.
File » Settings » Template language, do you have Template language setting set to django?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With