4👍
The latest PyDev versions include a Django template editor, but it’s not compatible with vanilla Eclipse. You have to use Aptana Studio instead.
Just use http://pydev.org/nightly as update URL, the PyDev and Django template editor packages should be there.
- [Django]-Django Rest Framework with ChoiceField
- [Django]-Distributed task queues (Ex. Celery) vs crontab scripts
- [Django]-Import error 'force_text' from 'django.utils.encoding'
13👍
For clarity
Django Templates Editor is only available with Aptana 3.0 and later. Pydev in eclipse alone does not support it. Aptana is available as an eclipse plugin or stand alone.
As mentioned by mcoconnor Window -> Preferences -> General -> Editor -> File Associations will give you a list of extensions.
- Choose *.html as the file type
- Select HTML.Django Templates Editor (Aptana) from Associated editors
- Click Default.
- Reload any html files you had open in the editor
This should make Aptana treat the Django specific markup correctly instead of reporting errors and also will offer code completion.
- [Django]-How to view corresponding SQL query of the Django ORM's queryset?
- [Django]-How to Unit test with different settings in Django?
- [Django]-After adding django-debug to App, getting "'djdt' is not a registered namespace"
6👍
The current recommended way of having a Django Templates Editor with PyDev is by using LiClipse: http://www.liclipse.com (which is a commercial counterpart made to keep PyDev supported — as such it has PyDev standalone and a bunch of other goodies builtin).
Note that by default the html editor in LiClipse is bound to .html and the django templates to .djhtml, so, you can either:
- open with > LiClipse Django Editor
- right-click an open editor > languages > Django
Or you can change the default association in:
- window > preferences > general > editors > file associations > *.html
- add LiClipse Django editor > set it as default.
- [Django]-Django Shell No module named settings
- [Django]-Register every table/class from an app in the Django admin page
- [Django]-Django – Site matching query does not exist
-1👍
If you install the Eclipse Web Tools Platform (WTP), it bundles a nice HTML editor, which does 95% of the syntax highlighting you’d want in a Django template. It also includes editors for other common web types, like JS and CSS, which are often nice when working with Django projects. This will also give you code completion and automatic tag closing for the HTML elements, at least.
If you use a .html extension on your template files, you’ll probably get the right editor by default when you open them up, but if not, you can associate the HTML Editor with whatever extension you use in the Window -> Preferences -> General -> Editor -> File Associations interface.
- [Django]-Django — Can't get static CSS files to load
- [Django]-Set Django set Integer Field minimum to 1
- [Django]-Django: Support for string view arguments to url() is deprecated and will be removed in Django 1.10