Migrate django project to eclipse/pydev ide

502 views
Skip to first unread message

Gary Roach

unread,
Dec 22, 2015, 6:32:46 PM12/22/15
to Django users
Hi all;

I have been working on a project for some time using Ninja-IDE.
Unfortunately the development on Ninja has - for all practical purposes
- stopped. It no longer works for me. I need to switch to Eclipse with
the Pydev plugin and am having trouble finding out how to do this. I
have looked at several howto's. So far I can follow them up to a point
and then what shows up on the screen starts to depart from what's in the
howto. The end result is that I can't finish the process. Also there is
no mention of virtual environments. This worries me. I have multiple
projects on my system.

I'm using:
Debian stretch Linux
Eclipse 3.8
pyDev 4.4.0
django 1.8,4
python 3.4
venv (not virtualenv) virtual environment
git with github repository
postgresql 9.4 dbms

Can someone point me in the right direction with this.

Gary R.

Andrew Farrell

unread,
Dec 22, 2015, 7:07:17 PM12/22/15
to django...@googlegroups.com
Could you also tell us:
1) Why you need to switch to Eclipse specifically rather than PyCharmSublimeText, or (the one I use) Atom?
2) What error Eclipse is showing or what functionality is not working?



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5679DD71.708%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

Clifford Ilkay

unread,
Dec 22, 2015, 7:54:18 PM12/22/15
to django...@googlegroups.com
On 22/12/15 07:05 PM, Andrew Farrell wrote:
Could you also tell us:
1) Why you need to switch to Eclipse specifically rather than PyCharmSublimeText, or (the one I use) Atom?

Andrew, there are things Eclipse does that those three editors don't do. For example, the Mylyn plugin and how it integrates Eclipse with Trac is unparalleled. I also find debugging with Eclipse to be quite good for the odd time that I need to step through code as opposed to prototyping in iPython.

Gary, move your existing project to some directory outside of wherever your default workspace is and create a new Django PyDev project with the same name as your existing project. Look inside the directory that got created and you'll see a couple of hidden files, .project and .pydevproject. Move those somewhere safe, delete the new project directory, move the existing project directory to the default workspace, and move the hidden files to the project directory.

You can also import an existing project.

As for virtualenv or venv, all you have to do is go to the project properties, select "PyDev - Interpreter/Grammar", "Click here to configure an interpreter not listed." and add the Python binary for your venv.
-- 
Regards,

Clifford Ilkay

+1 647-778-8696

Gary Roach

unread,
Dec 23, 2015, 9:02:37 PM12/23/15
to django...@googlegroups.com
To your first question, in one word $money. I would love to use PyCharm but I am not a commercial developer and can't see paying the freight for most of the commercial packages. I applied for a free version of PyCharm and never heard back from them. The biggest complaint with Eclipse that I have heard is the size of the package. I have a half terabyte of storage, a four processor cpu and 4 gbytes of ram expandable to 16 gB. I don't care if the package is functional. I'm not much of a purist in these matters.

Your second question is harder. Every howto I looked at was different. I'm sure that this is due to version changes. Bu still. So lets take the one at http://www.pydev.org/faq.html#PyDevFAQ-HowdoIimportexistingprojects/sourcesintoPyDev? since I am importing existing Django projects into PyDev and the project has never been in Eclipse we try option 1.
File > New . PyDev File > New > PyDev Project wizard and select as the directory the directory with your sources. So:
File (OK) > New (No pydev project wizard show ) > Project > Select a wizard (only Pydev shown) > dropdown PyDev .> PyDev Django Project and hit next. And we get a whole page full of choices  that are not covered in the tutorial. The next section talks about importing and setting the PyDev Django Project and adding 2 string sub variables ((on right click project > properties > PyDev PYTHONPATH) . Of course I'm still back there with this window with all of the choices starting with Project Name (easy), Project content (not sure), several selections that are pretty obvious and then 4 selections like Create 'src' folder and add to PYTHONPATH, Create link to ..., etc . By this time IV'E LOST IT. I can bumble along and come up with something but have no idea weather it's correct. This could really bite me later. Ever single howto that I have looked at has the same problem. I can figure out things if the howto is close but when big chunks have been left out? I've managed to get through Tango With Rango even using python 3.4 and Django 1.8 with not too much trouble. But this!

Like I said before, I can't afford to spend money on a commercial product and hope someone can point me in the right direction with Eclipse / PyDev.

Any help will be sincerely appreciated

Gary R.

Luis Zárate

unread,
Dec 28, 2015, 5:45:15 PM12/28/15
to django...@googlegroups.com
I use Aptana studio that is an eclipse fork and has pydev include also django is well supported.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/567B5203.6010408%40verizon.net.

> For more options, visit https://groups.google.com/d/optout.
>

--
"La utopía sirve para caminar" Fernando Birri



Gary Roach

unread,
Dec 30, 2015, 2:01:53 PM12/30/15
to django...@googlegroups.com
Thanks for the help. I am still a little confused about venv. Since I lock the interpreter to the specific copy of python in the virtual environment for a specific project, do I still have to activate and deactivate venv on the command line or can I ignore this step.

Thanks for your help

Gary R
-- 
Regards,

Clifford Ilkay

+1 647-778-8696
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

CLIFFORD ILKAY

unread,
Dec 30, 2015, 5:15:35 PM12/30/15
to django...@googlegroups.com
On 30/12/15 02:00 PM, Gary Roach wrote:
On 12/22/2015 04:53 PM, Clifford Ilkay wrote:
On 22/12/15 07:05 PM, Andrew Farrell wrote:
Could you also tell us:
1) Why you need to switch to Eclipse specifically rather than PyCharmSublimeText, or (the one I use) Atom?

Andrew, there are things Eclipse does that those three editors don't do. For example, the Mylyn plugin and how it integrates Eclipse with Trac is unparalleled. I also find debugging with Eclipse to be quite good for the odd time that I need to step through code as opposed to prototyping in iPython.

Gary, move your existing project to some directory outside of wherever your default workspace is and create a new Django PyDev project with the same name as your existing project. Look inside the directory that got created and you'll see a couple of hidden files, .project and .pydevproject. Move those somewhere safe, delete the new project directory, move the existing project directory to the default workspace, and move the hidden files to the project directory.

You can also import an existing project.

As for virtualenv or venv, all you have to do is go to the project properties, select "PyDev - Interpreter/Grammar", "Click here to configure an interpreter not listed." and add the Python binary for your venv.
Thanks for the help. I am still a little confused about venv. Since I lock the interpreter to the specific copy of python in the virtual environment for a specific project, do I still have to activate and deactivate venv on the command line or can I ignore this step.

As long as you've done the "Click here to configure an interpreter not listed." noted above, you don't have to activate/deactivate the venv at a shell. All you're doing with activate/deactivate is changing $PYTHONPATH on that particular shell.
Reply all
Reply to author
Forward
0 new messages