Using TextMate with Django

TextMate is a popular text editor for OS X.

(For those of us not lucky enough to have a mac, check out e - lets you use TextMate bundles and many of TextMate's features on Windows.)

One of the most interesting features is the ability to define "snippets", abbreviations which can be expanded into larger blocks of text containing placeholders. TextMate organizes most of its features -- including snippets, macros, templates, and drag-and-drop behaviors -- into language-specific "bundles."

There's a Django bundle, though it's not among the ones included with the application; you have to fetch it from the repository. It handles both Django templates and Django Python code. The bundle's Python snippets are built for the magic-removal branch of Django.


% mkdir -p ~/Library/Application\ Support/TextMate/Bundles
% cd ~/Library/Application\ Support/TextMate/Bundles
% git clone
% git clone

Users of TextMate 2, currently in alpha, should use a different path:

~/Library/Application\ Support/TextMate/Managed/Bundles

Alternatively a svn repository is also available here :

% svn co

Relaunch TextMate or choose Bundles -> Bundle Editor -> Reload Bundles to make the new bundles available.

The TextMate blog lists instructions here:

The bundle resides at:

The Django-Python syntax in particular is a work in progress, and suggestions and contributions are welcome.


Homages to Django and the pleasant color scheme of its website. Created by Jannis Leidel.


django textmate theme screenshot (small)

larger, download

Django (Smoothy)

larger, download

Syntax coloring examples

Stock HTML mode

Django template mode

Stock Python mode

Django Python mode

Last modified 10 years ago Last modified on Mar 26, 2014, 9:44:13 AM

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.
Back to Top