<commit_before>
from django.core.management.base import NoArgsCommand
from django.core.management.commands import syncdb

from mezzanine.conf import settings


class Command(NoArgsCommand):

    help = ("Performs initial Mezzanine installation by running Django's "
            "syncdb and South's migrations faked.")
    can_import_settings = True
    option_list = syncdb.Command.option_list

    def handle_noargs(self, **options):
        verbosity = int(options.get('verbosity', 0))
        syncdb.Command().execute(**options)
        if settings.USE_SOUTH:
            if options.get("interactive"):
                confirm = raw_input("\nWould you like to fake initial "
                                    "migrations? (yes/no): ")
                while True:
                    if confirm == "yes":
                        break
                    elif confirm == "no":
                        return
                    confirm = raw_input("Please enter either 'yes' or 'no': ")
            if verbosity >= 1:
                print
                print "Faking initial migrations ..."
                print
            from south.management.commands import migrate
            migrate.Command().execute(fake=True)<commit_msg>Changed install command to only fake migrations when South is installed.<commit_after>
from django.core.management.base import NoArgsCommand
from django.core.management.commands import syncdb

from mezzanine.conf import settings


class Command(NoArgsCommand):

    help = ("Performs initial Mezzanine installation by running Django's "
            "syncdb and South's migrations faked.")
    can_import_settings = True
    option_list = syncdb.Command.option_list

    def handle_noargs(self, **options):
        verbosity = int(options.get('verbosity', 0))
        syncdb.Command().execute(**options)
        if settings.USE_SOUTH:
            try:
                from south.management.commands import migrate
            except ImportError:
                return
            if options.get("interactive"):
                confirm = raw_input("\nWould you like to fake initial "
                                    "migrations? (yes/no): ")
                while True:
                    if confirm == "yes":
                        break
                    elif confirm == "no":
                        return
                    confirm = raw_input("Please enter either 'yes' or 'no': ")
            if verbosity >= 1:
                print
                print "Faking initial migrations ..."
                print
            migrate.Command().execute(fake=True)
{'fraction_non_alphanumeric': 0.08464189965530448, 'fraction_numerical': 0.0015319800842589046, 'mean_word_length': 1.7265135699373695, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4033519', 'n_tokens_mistral': 646, 'n_tokens_neox': 613, 'n_words': 179}