          django-admin.py or manage.py) if it can't be found.
          """
          try:
              app_name = get_commands(self.user_commands, self.project_directory)[subcommand]
              klass = load_command_class(app_name, subcommand)
          except KeyError:
              sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % (subcommand, self.prog_name))
              sys.exit(1)
          return klass
          
 
</s> remove         klass = load_command_class(app_name, name)
 </s> add         if isinstance(app_name, BaseCommand): 
            # If the command is already loaded, use it directly.
            klass = app_name
        else:
            klass = load_command_class(app_name, subcommand)
            if isinstance(app_name, BaseCommand): 
                # If the app_name is already loaded, use it directly.
                klass = app_name
            else:
                klass = load_command_class(app_name, subcommand)
          django-admin.py or manage.py) if it can't be found.
          """
          try:
              app_name = get_commands(self.user_commands, self.project_directory)[subcommand]
            if isinstance(app_name, BaseCommand): 
                # If the app_name is already loaded, use it directly.
                klass = app_name
            else:
                klass = load_command_class(app_name, subcommand)
          except KeyError:
              sys.stderr.write("Unknown command: %r\nType '%s help' for usage.\n" % (subcommand, self.prog_name))
              sys.exit(1)
          return klass
          
keep keep keep keep replace keep keep keep keep keep
 Fixed #5564 -- Fixed handling of the ProjectCommand used by startapp.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6402 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/core/management/__init__.py