Bottle Template Support?

血红的双手。 提交于 2019-12-10 09:33:17

问题


I'm using PyCharm 3.4.1 and learning MongoDB from Mongo University. In the code, they have us using Python to create html pages using the MVC pattern with bottle.

When I add a file of type .tpl to the editor in PyCharm, there is no "intellisense" or support for the model in the code. Changing it to be in the list of html file types helps some, but no python support in the editor.

Is there a plugin or some other change i can make to support editing better? Seems someone else asked something similar earlier in the year at How to get tpl files highlighted in pycharm?


回答1:


Bottle comes with a built-in template engine called SimpleTemplate which is not currently supported by PyCharm.

There is a relevant feature request: Bottle microframework support, but it doesn't explicitly state about .tpl syntax support.

I'd go and create a feature request in PyCharm's issue tracker asking about SimpleTemplate syntax support or, at least, vote up and comment in the existing issue.

For example, there is the similar feature-request for tornado template engine:

  • Add Tornado Template Support

It has currently 56 votes up which is probably increasing the possibility of seeing it happen.


As a workaround, you can configure .tpl file type under Settings -> File Types. It is possible to set highlighting rules there.



来源:https://stackoverflow.com/questions/25835876/bottle-template-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!