django-templates

Atom support for Django templates.

benjohnson

97,598

59

Bug Reports

0.5.0

MIT

GitHub

Atom support for Django Templates

Atom support for Django HTML templates. Originally forked from python-django-templates.tmbundle and Djaneiro.

Default Grammar

It's common for Django templates to have a .html extension. Unfortunately, this doesn't give Atom a ton of help in determining whether it should use the Django Templates grammar or the normal HTML grammar. If you put part of the path to your Django project in the "Default to Django Templates For File Paths Containing" setting, we'll change the grammar to Django Templates for any files that are .html and whose file paths contain the string you enter.

Settings Example

Emmet Integration

Out of the box, Emmet isn't aware of the Django HTML Templates grammar, so Django HTML Templates uses Atom's tab-based HTML autocompletion rather than Emmet's. As the Emmet-Atom Readme explains, this is an easy fix. All you have to do is add Django Templates to the the list of grammars in Emmet's keymaps/emmet.cson file:

# language-specific Tab triggers
# you can add more triggers by changing `grammar` attribute valuse
'[...], atom-text-editor[data-grammar="text html django"]:not([mini])':

Release Notes