[Django]-How to configure code completion for Django based projects in PyDev?

1👍

Ok I give it another try.

Eclipse in C:\test\eclipse

Python 2.6.2 in C:\test\python-2.6.2

Django 1.0.2 final in C:\test\python-2.6.2\Lib\site-packages -> only the actual django folder not the docs, example, and so on. I did this without running setup.py as descriped in the INSTALL file.

Added C:\test\python-2.6.2 and C:\test\python-2.6.2\Lib\site-packages to the PATH variable

As described here I set the Interpreter in Eclipse by Window > preferences > pydev > Interpreter > Python. This automatically included a whole bunch of things under System libs like (C:\test\python-2.6.2\;C:\test\python-2.6.2\DLLs;C:\test\python-2.6.2\lib\site-packages;….). A whole bunch of Forced Builtins are also found.

Then I made a new “Pydev Project” added a package and there a new module with a class and a module which imports the class and calls a function from it. During writing this pressed Crtl+Space several times, and builtins as well as the new stuff from my Module where shown by code completion.

👤jitter

0👍

I suggest Configuring pydev to work with django and

Getting started Eclipse/Pyddev

In the latter one there is a section specifically for code completion which mentions a problem with firewall or shell timeout. And in another section he mentions problems when (as in your case) the eclipse installations has spaces in the filepath

👤jitter

0👍

I solved setting the PYTHONPATH too.
In the pallet Projects, right-click on the project -> properties
In the PYTHONPATH configuration you have to put the folder that contains your project as a external folder.

Exemple:
/var/www/my_project
PYTHONPATH=/var/www/

Leave a comment