Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 471
md daudul islam sumon Avatar asked Oct 16 '22 04:10

md daudul islam sumon


2 Answers

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
like image 120
Farshid Ahmadi Avatar answered Nov 15 '22 07:11

Farshid Ahmadi


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).

like image 31
Python Dev Avatar answered Nov 15 '22 07:11

Python Dev