MauricioDinki / django-atom

Django package for atom
12 stars 8 forks source link

Atom not recognizing that it's a django html template; defaults to standard HTML when file is opened #13

Open lymanjohnson opened 5 years ago

lymanjohnson commented 5 years ago

If I open a django template .html file, Atom assumes that it's just a standard html file.

I feel like it didn't do this before. How do I get Atom to correctly recognize that a file is a django template as opposed to a standard html file?


EDIT: I solved this issue (by using a different package). Check out my instructions in my other comment further down the page.

diegolego commented 5 years ago

I have the same problem! Has anyone found a solution?

antnbr commented 5 years ago

Up ! I just installed django-atom and it doesn't recognize .html django template as well as specific django syntax in .py files. Anyone has a solution ?

musclemike commented 5 years ago

same Problem

sn-hebbar99 commented 5 years ago

same problem

erichamers commented 5 years ago

Same issue here. Doesn't seem like the dev is following the issues on github though =(

lymanjohnson commented 5 years ago

Hey guys, I found a solution to this problem. It involves using a different package similar to this one and tweaking the settings.

Step 1: Disable django-atom and install 'django-templates instead

Step 2: Go to your config.cson file (which you can get to by clicking on the "Atom" tab in the top bar and selecting "Config") and add the lines:

"django-templates":
    defaultToDjangoTemplatesForFilePathsContaining: [
      "*.html"
    ]

Put that block at the end of the file and make sure it's one indent in. If in doubt just format it similarly to the other pacakge configurations that are probably already in that file.

antnbr commented 5 years ago

ty very much for the tip ! I actually discovered the "django-templates" package suits me better because of the way you can bind it to choosen projects, as I also need standard html templates simultaneously. You're the man !

amc123-glitch commented 4 years ago

I have tried what you are saying but does not work, all of the Django packages appear to have been abandoned which makes me have to go back to using Sublime or VSCode when it comes to Django projects because manually changing the file type each time I open an html template.

mclintockmark commented 4 years ago

file extension needs to be html.django for this to work otherwise you will need to change the code to work properly. Under code remove the django from snippets and settings to force to work with just html extension, but some shortcuts may collide with html addons

snachman commented 3 years ago

Step 1: install 'django-templates

This is all I did, then changed the file syntax to "html (Django)" and it worked! Thank you!