当前位置:网站首页>让pycharm项目里面的文本模板支持jinjia2语法
让pycharm项目里面的文本模板支持jinjia2语法
2022-06-22 14:48:00 【晚风拂柳颜】
文件资源管理器找到项目的根目录的.idea文件夹中项目名.iml文件(隐藏文件)
用notepad++编辑这个iml文件,在component标签的同级,添加如下代码:
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/templates" />
</list>
</option>
</component>然后重启pycharm,发现Jianji2语法的代码高亮了,说明成功了

此方法等同于在pycharm设置里面可视化配置

这里还发现一个问题,这三个默认的模板文件无法删除
如果你只想html采用jinjia2引擎,但是xml不用这个引擎咋办?
答案是将xml文件所在目录标记为 排除

标记排除后文件夹显示效果是橘色,这样里面的文件就不会采用jinjia2语法了,比如快捷键注释就不会是 {# #}形式了
这样才能保证系统正常加载xml
2021-06-28补充
不要标记为排除了,标记为资源根是最好的,既能保证里面不会是jinjia2语法,也能保证全局搜索可以搜到
边栏推荐
- Bridging the gap between open source databases and database services
- phantomJs使用总结
- Cross border integration, creativity and innovation to help improve the influence of cultural tourism night tour
- 洛谷P2466 [SDOI2008] Sue 的小球 题解
- nvarchar和varchar的区别
- Rosbag use command
- Quickly play ci/cd graphical choreography
- 蓝桥杯2019年国赛最长子序列
- School enterprise alliance is on the way! Huawei cloud gaussdb has come to universities again
- stack和queue的模拟实现
猜你喜欢

Alibaba cloud middleware's open source past

Program substitution function

POD 类型
![[single chip microcomputer] [make buzzer sound] know the buzzer and let it make the sound you want](/img/cb/826b3591bafa62cc71826732eb32ef.png)
[single chip microcomputer] [make buzzer sound] know the buzzer and let it make the sound you want

Dear students, don't read the textbooks any more. Just read this one for the complexity of time

数值类型和字符串之间的转换

Navicat Premium 连接Oracle 数据库(图文教程)

Wechat applet avatar pendant production

pymssql模块使用指南

各位学弟学妹,别再看教材了,时间复杂度看这篇就好了
随机推荐
大佬们好,初次使用MySQL cdc 报错
默认函数控制 =default 与 =delete
华为机器学习服务银行卡识别功能,一键实现银行卡识别与绑定
Development status of full color LED display
蓝桥杯2019年国赛最长子序列
推荐几个AI智能平台
Wallys/DR7915-wifi6-MT7915-MT7975-2T2R-support-OpenWRT-802.11AX-supporting-MiniPCIe
Exploration and practice of dewu app data simulation platform
Quick sort_ sort
程序替换函数
uni开发微信小程序自定义相机自动检测(人像+身份证)
Promoting compatibility and adaptation, enabling coordinated development of gbase may adaptation Express
阿里云中间件的开源往事
着力打造网红产品,新捷途X70S焕新上市,8.79万起售
社区文章|MOSN 构建 Subset 优化思路分享
2020年蓝桥杯省赛真题-走方格(DP/DFS)
信创研究:国产数据库聚焦信创市场,华为Gauss有望成为最强
Recommend several AI Intelligent Platforms
得物App数据模拟平台的探索和实践
推进兼容适配,使能协同发展 GBase 5月适配速递