mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -979,10 +979,18 @@ def execute_manager(settings_mod): | |||||||
|     # Set DJANGO_SETTINGS_MODULE appropriately. |     # Set DJANGO_SETTINGS_MODULE appropriately. | ||||||
|     os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % project_name |     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 |     # Remove the "startproject" command from the action_mapping, because that's | ||||||
|     # a django-admin.py command, not a manage.py command. |     # a django-admin.py command, not a manage.py command. | ||||||
|     action_mapping = DEFAULT_ACTION_MAPPING.copy() |  | ||||||
|     del action_mapping['startproject'] |     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. |     # Run the django-admin.py command. | ||||||
|     execute_from_command_line(action_mapping) |     execute_from_command_line(action_mapping) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user