Autocomplete in Pycharm on templates

2019-04-01 23:05发布

Whenever I make a function, make it a view and map a template onto it, the auto-complete in PyCharm works. If you type in something like {{ book. }}, where book is a model, and is one of your context objects, then it will give you a drop-down menu with possible completions.

However, if you make a class based view, then this does not work. Any way that I can fix this?

标签: pycharm
1条回答
叼着烟拽天下
2楼-- · 2019-04-01 23:39

I solved a similar problem via a marginal method.

I'm using both PHPStorm and PyCharm and twig template engine most similar Tornado or DJango template engines syntax.

I've opened settings window/Plugins section. Clicked to "Install plugin form disk..." and selected ".../JetBrains/PhpStorm x.x/plugins/twig/lib/twig.jar"

Clicked "Ok" Clicked "Apply" And restarted "IDE"

template file name extension renamed to .twig and done!

pycharm tornado template endgine via twig plugin

查看更多
登录 后发表回答