Skip to content Skip to sidebar Skip to footer

Html Files Recognized As Django Template In Vs Code

I'm new to VS Code, coming from ST3 and TextMate before that. A bit flummoxed why is HTML not autodetected nor is it offered as a choice of language after clicking on the lower-rig

Solution 1:

Include the following line of setting emmet.includeLanguages": {"django-html": "html"} in VSCode's settings.json:

{"python.jediEnabled":false,"files.autoSave":"afterDelay","editor.suggestSelection":"first","vsintellicode.modify.editor.suggestSelection":"automaticallyOverrodeDefaultValue","editor.minimap.enabled":true,"workbench.colorTheme":"Monokai","editor.largeFileOptimizations":false,"html.format.indentInnerHtml":true,"html.format.indentHandlebars":true,"emmet.includeLanguages":{"django-html":"html"},"[django-html]":{},"files.associations":{"*.html":"html"}}

It does the fix for me on version 1.33.1

Solution 2:

Solved! I began eliminating extensions and found that Django Template 1.2.0 (bibhasdn.django-html) is to blame. As soon as I disabled it, the HTML option returned to the Language Associations menu. Hat tip to @ifconfig for confirming I should expect it to be present.

Solution 3:

image for the same

1) Click on "select language mode" from bottom right toolbar.

2) Select "Configure file association for .html" from the dropdown.

3) Select html from the dropdown.

This will remove html file being marked as Django-html every time you create a html document.

Solution 4:

These settings worked for me in vscode settings.json

"files.associations":{"**/templates/*.html":"django-html","**/templates/*":"django-txt","**/requirements{/**,*}.{txt,in}":"pip-requirements","*.html":"html"},"emmet.includeLanguages":{"django-html":"html"}

Solution 5:

Python Extension Pack that included DJANGO packages made VSCOde see all html as Django Template and set comments as {%comment%} instead of <!-- -->

Removing it solved the issue.

Post a Comment for "Html Files Recognized As Django Template In Vs Code"