I’ve just recently started using Django and I wanted to set up an IDE for some coding niceties.
I already use Eclipse for PHP development, so I installed the PyDev plugin for Eclipse.
Now I get autocomplete in the py files, but when writing the Django html templates, there is no autocomplete for the various template tags.
So here’s a quick guide to adding your own tags in Eclipse.
- In Eclipse, go to Window->Preferences
- Go down to Web and XML.
- Then to HTML files and finally Templates
- You will see a list of all the various HTML templates there.
- Click on New.
- Give your tag a name. It can’t be one that’s already taken, but I found I didn’t have any issues. If you want to keep them all together you could start your tag name with ‘DJ’.
- Select HTML Tag from the drop down.
- Give your tag a description.
- Type in the the tag pattern. If you want the full tag on autocomplete, you might type in {% block ${cursor} %}, otherwise you could start with block, which means you would need to type in the {% and then activate the autocomplete in the HTML editor. The ${cursor} places the cursor where you want it after the tag has been inserted.
- Click Apply and OK.
- Test this out in the HTML editor. Press CTRL and Space. You should get a list of available tags. Type b (or what ever the first character is for you tag name), and you’ll see your block tag with the description next to it.
- Press enter, and your tag will appear.
Hopefully this will make your Django coding a little easier.



