Can't find "Set as Django Project" or Django actions in Eclipse with Pydev - django

MacOSX10.9.5, EclipseMars.1(4.5.1), Pydev3.0.0, Python3.4.3, Django1.9
I can't find "Set as Django Project" or Django actions in Eclipse though I could use it until yesterday.
I reinstalled the same versions of Python, Django, Eclipse and AptanaStudio3, and added Python and Django PATH to PYTHONPATH of Pydev Python Interpreter in Preferences again but the problem is not solved. I can't also create a new Pydev project. Maybe I deleted some important dotfile by mistake when I emptied the trash but I'm not sure if I did or if it's the cause or not. How can I fix the problem or what should I check to figure out what is the cause? Thank you in advance.

I solved the problem by myself. I just didn't notice the Pydev perspective was closed.
Window --> Perspective --> Open Perspective --> Other... and choose Pydev.
That's all. Now I can see Set as Django and Django actions with the Django logo. I had overlooked such a basic. Thank you!

Related

Eclipse Modelling Framework - Package Properties are missing and package cannot be renamed

I'm following this tutorial
https://eclipsesource.com/blogs/tutorials/emf-tutorial/
and getting stuck at the step "Open Show Properties View". The tutorial tells me to give the package a new model name and an URL but my Eclipse doesn't give me the option do this tasks. Does anyone know why?
where I get stuck at
my eclipse
The problem was solved by changing the appearance of eclipse to light mode

Django autocomplete in Eclipse

I want to use the autocomplete of PyDev with Django in Eclipse. I've followed these two threads
Autocompletion in Django + pydev
PyDev and Django: Autocomplete not detecting Django?
so I went to
Windows -> Preferences -> PyDev -> Interpreters -> Python Interpreter
selected the libraries tab and added path\to\Django\Django-1.6.1\django
and then right-clicked on Project's name then Preferences -> PyDev - PYTHONPATH
clicked on the external libraries and added the project folder and
C:\Python27\Lib\site-packages
finally I went to
Window->Preferences->PyDev->Editor->Code Completion
and checked that the autocomplete was on and it was so. But still don't have the auto-complete on. But it doesn't even autocomplete the variables that I have defined in the same class. Could anyone help me on this?
I fixed this myself. The problem wasn't related to PYTHONPATH or anything like that I had said above. The problem was with Aptana! I also noticed that Aptana that is now available for Windows x86 was 3.4.2 rather than 3.5 that was installed before. I think they had noticed that there are bugs in 3.5 and are now providing the 3.4.2 version.
To fix this simply reinstall Aptana.
Note: if you are getting "Port not bound (found port -1). Is there an enabled firewall?" after you enter some text and try [Ctrl + Space] you likely have the same problem.
Hope that helps for you.

Newly created Pydev Django Project does not include initial package with Settings.py etc

When creating Django Pydev projects in Eclipse the default config package is created automatically with the following structure:
MyApp
__init__.py
settings.py
urls.py
wsgi.py
manage.py
Today I created a Django Pydev project and those files and initial package were not created.
I have tried several times to create new Django Pydev projects but the the initial structure is not being created.
This problem only just started happening. I have not had the problem prior to today.
Running this on the command line does work:
django-admin.py startproject mysite
The files and project structure are created correctly. So it's just Eclipse and Pydev that fails.
I am using Django 1.4, Pydev 2.5 and Eclipse Indigo 3.7 on Ubuntu 11.1
I had the same issue today but it turned out that it was because my project name was not handled - eg "My Project". The space threw it. Calling the project "MyProject" worked a treat.
From the cmd line it gives the following error - which eclipse is not returning:
c:\django-admin.py startproject "My Project"
Error: "My Project" is not a valid project name. Please use only numbers, letters and underscores.
I ran into the same issue on win7.
I also tried to run django-admin.py manually from command line. Instead of generating a project, it opened up a default editor for .py file. Then this was clear to me that it was because I installed some program which registered itself as the default program to run .py file. In my case it was WebMatrix2 but even if you don't install anything, there is a good chance that it is set to notepad by default by win7.
I knew that PyDev will actually run django-admin.py to generate the project. So my guess was that PyDev tried to run the .py file. Then since the program to run it was not python.exe, nothing was generated. PyDev ignored this error so there was nothing in the project.
Then the fix is simple. Choose any .py file, right click to open the properties window and change the default program to python.exe.
Now go back to Eclipse and try to create a django project again. You should be able to see manage.py file and other files created.
Hope this helps.
I was having this problem - I tried to create a project called test-django, and it wouldn't add manage.py etc to the structure. So I tried doing the same thing with django-admin.py and it failed and said only numbers, letters and underscores!
So the problem is that eclipse/pydev fail to report this error and make the project anyway!
I had a similar issue today (Win7). I had been using eclipse, PyDev and Django for a while and had no problems. Tried to create a new project today, and it failed to populate the project folder with manage.py etc.
I happen to have both Python 32 and 64 bit installed, but Django 32 bit. I forgot to select the 32 bit interpreter when I created the project, and so it called the 64 bit interpreter to run django-admin.py and failed silently. Once I selected the 32 bit interpreter it created the project folders as expected.
Met the same issue when creating a PyDev Django project in the virtual environment.
Unable to find out any effective solution either in Chinese or English. After a few tries, I've managed to resolve it
When creating the PyDev Django Project, instead of putting your project folder in the virtual environment folder, you need to choose another directory outside.
Eclipse Pydev Screenshot
I tend to believe this is a PyDev bug, as I can put my django project folder anywhere using the command:
django-admin startproject PROJECT_NAME.
It works fine in the virtual environment folder. Refer to my setup environment below:
Eclipse Oxygen: 4.7.1a
PyDev : 6.1.0.201711051306
Django : 1.11.7
Just to note, provided you have the latest PyDev, this should work (previous versions had issues with Django 1.4) -- it's possible that it's just missing a refresh (i.e.: it's creating it but not showing in the PyDev package explorer).
Just refresh it and see if it works -- and make sure you have 'refresh using native hooks' and 'refresh on access' selected on window > preferences > workspace.
If you still have an issue, please check if they really weren't created in the filesystem and if they weren't check your error log for some error there and report back.
Had the same issue.
Fixed by doing Help -> Check for Updates.
Updated Eclipse and restarted.
i met this issue, too.
However, after devastatingly searching online. I'd decided to re-install the plugin with a brand new Eclipse for Java EE Developer, Version: Indigo (previous was Classical Eclipse, Indigo).
And it worked!
I know this question was asked long time ago, but I faced the same problem with Eclipse Neon and I figured out possibly there is a bug.
I guess you used File>New>PyDev Project to create a project. I used MyProject as the name of the project so I did not have any space in the name, and therefore project name could not be the issue. You should see 3 steps to configure your project, while the 3rd one is not shown. The 3rd step is Django Setting and if you cannot get to that step, your files will not be created.
Instead if you use CTRL+N, you will see a different wizard and this way it takes you to 3rd step and all the file will be generated.

Is there a way to make aptana 3 autoreload when i make changes to a py file in a django project?

Aptana makes it open in --noreload mode automatically because not doing so causes python instances to remain open or something like that, is there anyway to bypass this problem?
As far as I know, it's not possible to auto-reload .py files within an Aptana Python run/debug configuration (which is what I'm assuming you're doing to get access to the call stack for debugging). I've been using Aptana for Python development for a couple of years, and I've yet to see a way to do this. if someone knows how, please share!

Komodo Code Completion for Django

Sorry to repeat old questions, but I didn't quite understand the answer.
The question was: How to enable auto-complete in Komodo Edit 5.2 for Django
Komodo Edit - code-completion for Django?
"It was already on my python path (could import django stuff via plain old python shell), however,komodo didn't know about it. Manually adding the dist-packages folder fixes it though"
In particular I don't understand the part in bold.
Can you give me a simple step by step recipe for that, please?
Using OSX Snow Leopard.
Thanks,
Greg
Go to File -> Preferences -> Languages -> Python. There you have the field Additional Python Import Directories where you can add the Django folder (actually the folder that contains the Django folder).