From e4fb3982a1c50f723bb5f9da55567f26cae351e2 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 16 Dec 2005 01:19:59 +0000 Subject: [PATCH] magic-removal: Changed manage.py behavior so that it 'startapp' always creates the app within the project directory git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1679 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/django/core/management.py b/django/core/management.py index 520a6ba271..9a2f62cd82 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -979,10 +979,18 @@ def execute_manager(settings_mod): # Set DJANGO_SETTINGS_MODULE appropriately. os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % project_name + action_mapping = DEFAULT_ACTION_MAPPING.copy() + # Remove the "startproject" command from the action_mapping, because that's # a django-admin.py command, not a manage.py command. - action_mapping = DEFAULT_ACTION_MAPPING.copy() del action_mapping['startproject'] + # Override the startapp handler so that it always uses the + # project_directory, not the current working directory (which is default). + action_mapping['startapp'] = lambda app_name, directory: startapp(app_name, project_directory) + action_mapping['startapp'].help_doc = startapp.help_doc + action_mapping['startapp'].args = startapp.args + # Run the django-admin.py command. execute_from_command_line(action_mapping) +