Sunday, March 21, 2010

Django on Pydev

The current nightly build (which will be 1.5.6) is already providing some special support for Django (special thanks to Leo Soto for providing a good base for building upon).

There are still some details until the final release, but I'd like to get some feedback before that.

The special support goes in the following:

1. Create a 'Pydev Django' project (will use django to create a manage.py, settings.py and urls.py)



2. For an existing project, just right click it and choose 'Pydev > Set as Django project)'




3. Custom Django actions can be accessed right clicking a project with the Django config and choosing Django > action.



4. Note that the Shell with django environment will create a shell properly configured with your settings, providing the default features from the pydev shell, such as code completion, history, context assistants (ctrl+1), etc (see: http://pydev.org/manual_adv_interactive_console.html for more details)




5. Run as Django/Debug as Django are available (note that they set the --no-reload by default, otherwise the debugger may have some issues and other processes may be kept alive when closing the process spawned by Pydev).



And that's it. It's all there in the nightly build already (I still have some features and minor adjustments to do, but that should already give a good idea of what will be available, and I'm waiting for feedback to know if there's something missing that really should be there).

16 comments:

Jaime said...

That's really great news! I cant' wait 'till it's finished...

I usually have some problems with the definitions of the Django modules and names in PyDev, probably because it doesn't detect propperly all the Django modules, and end with some "false errors" on the projects. Are you improving this issue? I know Django makes some dynamic loading, so maybe it's difficult.

Also, what I miss is some support (syntax and autocompletion) with the templates. It will be great to help with that, too..

I use PyDev almost every day and I think it's really great tool! I want to add a "good job" statement to the message ;-)

Dan said...

Looking great. These will be very useful features.

Kumo said...

Thanks!

Ronald said...

Great additions, pydev will be even more useful now.

The only additional feature I'd ask for is to be able to run tests through the django test runner.

Vee said...

This is exciting, can't wait to check it out.

Feature request right off the bat - since you are doing a right-click menu for various manage commands (and it's great to have most common ones up top) - how about adding "Other" submenu which will dynamically load up, essentially, the output of "manage.py help" and provide one-click access to numerous other manage.py commands, particularly custom ones added by developers.

Anonymous said...

Excellent opportunity! Thanks

Anonymous said...

Looks great, syntax highlighting of templates would be great, would code completion in templates be possible?

David Arcos said...

Great, thanks!

Hasan said...

Good to see django support in PyDev. The nightly repository seems to be down (http://pydev.org/nightly), eclipse throws an error.

Anonymous said...

Great news, what about Django template auto code completition, would this also be implemented in future releases?

Fabio Zadrozny said...

Hi all, thanks for the comments and suggestions.

There's a new post explaining the common doubts here: http://pydev.blogspot.com/2010/03/django-on-pydev-take-2.html

Anonymous said...

This is really tremendous. Thanks to all the pydev hackers!

Anonymous said...

this is great, but there's one problem: my project is placed in a virtualenv, and the eclipse-console cannot find die needed libs. is there any way to tell pydev that it's within the virtualenv?

Quran said...

Django is good but i always face problem using it, why i don't know, i always try to find out the problem but not able to find out.

Anonymous said...

Hi, is there any way round the "--noreload" restriction? For me one of the killer features of Django is being able to edit the code, then just reload the page to see my changes. Having to stop and restart the server all the time is a pain - I'll just stick to running it from the command line in that case.

Fabio Zadrozny said...

Yes, you can edit the run configuration that was created when you did a run as django (under run > run configurations > pydev django > choose the run configuration > remove --noreload from the arguments tab).

Note that doing that will prevent you from using the debugging properly, in which case you have to use the remote debugger. See: http://pydev.org/manual_adv_remote_debugger.html )