Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 889
Lorien Avatar asked Jun 07 '12 11:06

Lorien


People also ask

How does the Django integration in PyDev work?

The Django integration in PyDev works through 3 main configurations: 1. The project must be marked as a Django project inside of PyDev. 2. A DJANGO_MANAGE_LOCATION string substitution variable must point to the project-relative location of manage.py. 3.

What is the shell with Django environment action?

Note that the Shell with django environment action 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), making an execfile of the editor, etc (see: Interactive Console for more details).

How do I change the default run parameter in Django?

Run as Django/Debug as Django are available (note that they set the --noreload by default). This will create a default Run configuration, so, you may edit it later through run > run configurations (or debug > debug configurations) if you want to change a parameter.

How do I execute a Django action from the command line?

Django actions can be accessed right clicking a project with the Django configuration and choosing Django > action. ctrl+2+dj <enter> to open a dialog with the history of entered actions ctrl+2+dj action_to_execute <enter> to already pass the action to be executed (e.g.: ctrl+2+dj help <enter>)


1 Answers

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.

like image 197
Derrick Avatar answered Oct 07 '22 16:10

Derrick