问题
I am new in using PyCharm but I am loving it gradually. I am getting a red underline on <!DOCTYPE html>
and the error is "Unexpected Token".
Why PyCharm shows it? I can't understand.
回答1:
It usually happened when you don't enable Django in Pycharm setting. to resolve the problem:
1- In Pycharm open Setting in File menu
2- Select and expand Languages & Frameworks
3- Select Django and enable it
4- Select your Django project root
5- Select your project setting.py file
6- Select your project manage.py file
7- Apply setting
8- Enjoy Your Life!
回答2:
PyCharm does not provide support for the Django framework in the free community edition. The best solution may be to go with another IDE (at least until support is added).
来源:https://stackoverflow.com/questions/61277709/unexpected-tokens-in-doctype-html-in-pycharm-community-edition