Make creating apps inside project folder more intuitive with manage.py startapp command
|Reported by:||Owned by:||vanessagomes|
|Component:||Core (Management commands)||Version:||1.5|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
The structure of the project created by 'django-admin.py startproject' has changed from Django 1.4. The 'manage.py' file is at the same level where the project folder containing settings.py, urls.py is present. In order to create an app within the project as was possible with Django < 1.4, the command to be used is 'python manage.py startapp <app name> <destination folder which is optional>. So if I execute the command "python manage.py startapp myapp myproject", there is an error that says "Error: <full path>/<project name>/<project name>/init.py already exists, overlaying a project or app into an existing directory won't replace conflicting files". The command actually expects an empty directory having the name of the app inside the project directory to work correctly. So the user has to create that directory and then create the app. This isn't very intuitive and django should create the app directory if it doesn't exist and then create the app to show the same behaviour as the previous versions.
One other way to work around this behaviour is to change to the project directory and then execute python ../manage.py startapp appname.