I have done a little Django development, but it has all been in a text editor. I was curious what more advanced development tools others are using in their Django development.
I am used to using Visual Studio for development and really like the IntelliSense, code completion, and file organization it provides and would like to find something (or a combination of tools) that would provide some of this in the Django/Python environment.
I use Eclipse and a plain vanilla PyDev. There isn’t any specific Django functionality. The best I came up with was setting up a run profile to run the development web server.
If you add the web tools project (WTP), you’ll get syntax highlighting in your templates, but nothing that relates to the specific template language. PyDev is a decent plugin, and if you are already familiar with Eclipse and use it for other projects it is a good way to go.
I recall NetBeans starting to get Python support, but I have no idea where that is right now. Lots of people rave about NetBeans 6, but in the Java world Eclipse still reigns as the king of the OSS IDEs.
I am beginning to enjoy working with Aptana Studios + PyDev (and other) plugins for all sorts of web application development. As you can tell, it is built on top of the powerful Eclipse, but is tailor-designed to focus on web application development.
I use Kate (KDE Advanced Text Editor) for most of my development, including Django. It has both a Python and Django Templates syntax higlighting. I switch to Quanta+ when a significant part of the project involves HTML.
Since it uses Kate’s KPart, it’s just as good for editing the Python parts, and for the HTML templates i have the whole Quanta+ tools, while still highligting Django-specific tags.
Update 2013: Unfortunately, Quanta+ has been dead for years now, and there’s no hope that it will ever be resurrected. Also, there’s no other usable HTML editor out there, so it’s Kate all the time now.
NetBeans for Python is my current favorite (lighter and so much easier to install than Eclipse I found). Supports simple refactoring, autocompletion, errors/warnings…
EclipseAptanaPyDev probably one of the most complete free IDE nowadays (haven’t tested a lot)
Wingware Python IDE a commercial IDE, which has some Django-specific project setup features the ability to debug Django template files.
IntelliJ IDEAUltimate Edition another commercial IDE which has also a plugin for Python that is under heavy development. I saw some demo which look very promising on the auto-completion (for templates and Python).
As far as I know there is not “an IDE” for Django, but there are some IDEs that support Django right out of the box, specifically the Django syntax for templates.
The name is Komodo, and it has a lot of features, but it’s not cheap. If you are not worried about source control or debugging then there is a free version called Komodo Edit.
There is an actual Python extension for Visual Studio: http://pytools.codeplex.com/. It’s absolutely fantastic. It feels the same as if I were coding in any native Visual Studio language. The extension is even compatabile with Django. And best of all: it’s totally free. Even for Visual Studio, it only requires the Visual Studio Shell to work, which is completely free.
Create a new project from existing code (menu File → New → Project From Existing Code…)
Specify your Django project folder and use the defaults.
Right-click on manage.py and choose Set as Startup File.
In your project properties Debug tab, add “runserver” in Script Arguments.
You can set break points, and attach to the Python process for debugging. If you want to debug without having to “attach to process,” use “runserver –noreload” in your script arguments. However, the “–noreload” means you’ll have to stop and restart the Django development web server manually (to recognize your code changes).
This is a nice setup if you already use Visual Studio.
Python Tools has been updated. It has built in support for Django now.
I have used Eclipse with PyDev and PyCharm. PyCharm is definitely the best IDE for Django/Python I have tried. It does proper template highlighting and auto-completion for all objects. It also does cross-file referencing.
I’ve also had good results with Eclipse and Pydev. Although I still require a shell opened to the project directory to run manage.py commands. I’ve also been using it with the Bazaar plugin for revision control and syncing code with the server.
回答 18
我非常喜欢E Text Editor,因为它几乎是TextMate与Windows 的“连接” 。显然Django是基于Python的,对自动完成功能的支持是有限的(没有像intellisense这样的东西需要专门的IDE来了解每个库的复杂性),但是使用摘要和“单词完成”功能有很大帮助。此外,它还支持Django Python文件和模板文件以及CSS,HTML等。
我已经使用E Text Editor很长时间了,可以告诉您,在使用Django时,它胜过PyDev和Komodo Edit。对于其他类型的项目,PyDev和Komodo可能更合适。
I really like E Text Editor as it’s pretty much a “port” of TextMate to Windows. Obviously Django being based on Python, the support for auto-completion is limited (there’s nothing like intellisense that would require a dedicated IDE with knowledge of the intricacies of each library), but the use of snippets and “word-completion” helps a lot. Also, it has support for both Django Python files and the template files, and CSS, HTML, etc.
I’ve been using E Text Editor for a long time now, and I can tell you that it beats both PyDev and Komodo Edit hands down when it comes to working with Django. For other kinds of projects, PyDev and Komodo might be more adequate though.
I use Kate as well. Kate’s simplicity is its biggest feature. It doesn’t get in your way. (This is of course highly subjective opinion.)
Kate includes a Python code browser plugin. But it isn’t useful IMO. No automatic updates when you change the code/view. Also when you update, the whole tree is collapsed, and you have to expand it again yourself. Too many clicks.
Instead, I use the Source Browser plugin that comes with Pâté. It does cause Kate to freeze temporarily sometimes, but no crashes or anything of that sort so far.
I made a blog post about NetBeans’ new and upcoming support for Django. When paired with its already fantastic Python, JavaScript, HTML and CSS support, it’s a strong candidate in my mind!
TextMate with the Django and django-html bundles installed gives you syntax highlighting and great extensibility. It is lightweight and fun to use.
Here is a link to a code completion project for TextMate with Python (which I haven’t used myself). As for “intellisense” (which I understand to be inline-doc reference), TextMate has that too.
The Wingware editor from http://www.wingware.com is Python-specific with very good auto-completion for Python/Django/Zope, etc.
It has a built in Python shell to run snippets (or select and run) and support for Mercurial/Git, etc. and a built-in unittest/nose/doctest test runner. It’s commercial though, but as it is written in Python, it’s cross platform.
I bought it a while ago, and thought it looked dorky, but I’ve tried them all and keep coming back. Caveat that I am a Windows guy with no Emacs or Vim skills, so leveraging that was not an option. And the Mac version requires X Window and seems to be more glitchy.