views:

243

answers:

4

This Django ticket says that they will not add a default Django template file extension. What file extension do you use?

A: 

.djt

It's short and shows that the template is Django specific.

Spencer
+4  A: 

For HTML pages: .html
For XML data (RSS and such): .xml
Etc

Just because they're templates doesn't mean they should have some sort of special extension.

As mentioned in the ticket:

  1. You already know the files are templates because they should be in a template directory
  2. You don't want to have to open up files to see what they are (HTML, CSS, XML, etc). You would have to do this with a generic extension like .djt.
  3. Most editors get this right with the proper filetype extension anyways so there is little reason to change this convention.
  4. However, something like .djt could allow for Django specific icons and syntax types.
Nick Presta
+1 except for maybe #4. There's no need for new magic here. Vim and Notepad++ already know about Django template tag highlighting so it may not even be necessary for a `.djt` extension. This ain't Rocket Surgery.
Peter Rowell
+4  A: 

Ruby on Rails uses .erb.html for html erb templates, something similar will work for django too.

adamse
A: 

I use the same name I would use for this file, if it wasn't a template. Thanks to this, I instantly know, what to expect inside. And for me every file that is being served is through views is a template, it sometimes just isn't filled with anything or even doesn't use markup language.

gruszczy