I love the PyCharm's ability to recognize one code type inside another. It is very convenient to use all the help to edit, say, SQL query inside a python function. However, I noticed if you have an HTML snippet inside the python code, it's not recognized as HTML, just as mere string. Time to fix it.
1. Go to
Preference -> Language Injections
2. Press
Add (the plus sign icon under the list of existing injections) and choose
2. Generic Python
3. Enter the following in the dialog.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6530IiSFQq_hwOBT55a2g4sFEOgrvaYONkzXnsq160KCf6BrrNbzheOiX037Fa4tKTVY_U9aK0Dcit0JVele1RqblFYV7Cmm88W_TQSudtIYLma19-P1vhv6h47FWV24jc5JDC9nAwxt5/s400/Screenshot+2019-03-06+10.22.04.png)
4. Press OK to save all your changes
Now go to a python file and try it