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

这周听了老师讲关于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/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值