Ticket #17379: 17379-2.diff

File 17379-2.diff, 2.0 KB (added by lpiatek, 13 years ago)
  • django/core/management/base.py

    diff --git a/django/core/management/base.py b/django/core/management/base.py
    index db855e1..730bd49 100644
    a b class BaseCommand(object):  
    204204        stderr.
    205205        """
    206206        show_traceback = options.get('traceback', False)
    207 
     207        self.stdout = options.get('stdout', sys.stdout)
     208        self.stderr = options.get('stderr', sys.stderr)
     209       
    208210        # Switch to English, because django-admin.py creates database content
    209211        # like permissions, and those shouldn't contain any translations.
    210212        # But only do this if we can assume we have a working settings file,
    class BaseCommand(object):  
    215217                from django.utils import translation
    216218                saved_lang = translation.get_language()
    217219                translation.activate('en-us')
     220                if int(options.get('verbosity', 1)) >= 2:
     221                    self.stdout.write("Active language set to 'en-us'.\n")
    218222            except ImportError, e:
    219223                # If settings should be available, but aren't,
    220224                # raise the error and quit.
    class BaseCommand(object):  
    225229                sys.exit(1)
    226230
    227231        try:
    228             self.stdout = options.get('stdout', sys.stdout)
    229             self.stderr = options.get('stderr', sys.stderr)
    230232            if self.requires_model_validation:
    231233                self.validate()
    232234            output = self.handle(*args, **options)
  • django/core/management/commands/shell.py

    diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py
    index 26cbd7f..507f3a7 100644
    a b class Command(NoArgsCommand):  
    99    )
    1010    help = "Runs a Python interactive interpreter. Tries to use IPython, if it's available."
    1111    shells = ['ipython', 'bpython']
     12    can_import_settings = False
    1213    requires_model_validation = False
    1314
    1415    def ipython(self):
Back to Top