python template languages_解决python - PyCharm: Forcing Django Template Syntax Highligting

令狐和裕
2023-12-01

这周听了老师讲关于django的框架问题,第一次比较透彻的了解了mtv框架。也是第一次接触模板的概念,研究了一下,现在就记录下来好嘞。。。   首先要介绍一

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.

python

django

pycharm

|

this question

edited Oct 27 '13 at 11:59

jb. 9,676 8 57 99 asked Jan 16 '12 at 13:26

andre_b 163 3 10

|

1 Answers

1

解决方法

File » Settings » Template language, do you have Template language setting set to django?第一步:安装python(最好安装2.x的版本,3.x的版本目前还不支持Django)   我装的是python2.7,下载网址: http://www.python.org/getit/releases/2.7/ 安装过

|

this answer answered Jan 16 '12 at 13:39

demalexx 2,643 1 19 29 1   Brilliant, I knew it would be something simple. Thanks very much. –

andre_b Jan 16 '12 at 13:49      many many thanks –

garmoncheg Jul 17 '12 at 15:05 3   As of PyCharm 3.x, it's in File » Settings » Python Template Languages. I used this same setting to activate syntax highlight in .js files that I'm using as templates. –

Seth Jan 13 '14 at 22:49 1   Using the green + icon, you can add filetypes too. This helped me with Django templates used for plain-text emails. –

Joe Tricarico Aug 15 '14 at 15:28 3   is there a feature like thin in pycharm community edition ?? –

Abinash Koirala Nov 19 '14 at 12:14

|

show more comments

第一步:安装python(最好安装2.x的版本,3.x的版本目前还不支持Django)       我装的是python2.7,下载网址:   http://www.python.org/getit/releases/2.7/

 类似资料: