Search code examples
djangoeclipseopenshiftpydevliclipse

Are openshift and pydev really full compatible?


I'm just trying to create a "Hello World" django application using Liclipse (licenced) and hosting in openshift. Among all the trouble that I found (import errors, not found in the pythonpath, etc) I note that eclipse seems not to recognize the project as a django pydev application. I can't use the right click django menu actions like "Create application (manage.py startapp)" or "add to pythonpad" because I get "Unable to perform action because the Pydev nature is not properly set" or "The pydev nature is not configured on the project". If I try to set the project pydev nature, nothing happens. I could create a basic django project with a working "admin" page, but if I add views.py, I'm not able to import it to urls.py, because they are not in the pytonpath. I don't have any problem developing local projects. Please help. Is there anybody really doing django projects with eclipse pydev on openshift or this just doesn't work? Thanks.


Solution

  • After adding the natures (both pydev nature and django nature), you also need to:

    1. add the needed folders to the pythonpath (see http://www.pydev.org/manual_101_project_conf2.html for details on configuring the pythonpath)

    2. config the variables in the project properties related to django in the project properties see http://www.pydev.org/manual_adv_django.html -- namely: DJANGO_MANAGE_LOCATION and DJANGO_SETTINGS_MODULE.