Search code examples
pythondjangopycharmjetbrains-ide

Unexpected tokens in <!DOCTYPE html> in PyCharm Community Edition


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.


Solution

  • It usually happens when you don't enable Django in Pycharm's settings. 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