<s> from __future__ import unicode_literals <EOL> from __future__ import print_function <EOL> from django . core . management . base import BaseCommand , CommandError , make_option <EOL> from django . utils import translation <EOL> from django . conf import settings <EOL> from data_migration . migration import Importer , Migrator <EOL> import sys <EOL> class Command ( BaseCommand ) : <EOL> help = '<STR_LIT>' <EOL> can_import_settings = True <EOL> option_list = BaseCommand . option_list + ( <EOL> make_option ( '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> default = False ) , <EOL> make_option ( '<STR_LIT>' , <EOL> action = '<STR_LIT>' , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> default = [ ] ) , <EOL> make_option ( '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> default = False ) , <EOL> ) <EOL> def handle ( self , * args , ** options ) : <EOL> translation . activate ( settings . LANGUAGE_CODE ) <EOL> excluded_apps = options . get ( '<STR_LIT>' , [ ] ) <EOL> sys . stdout . write ( "<STR_LIT>" ) <EOL> Importer . import_all ( excludes = excluded_apps ) <EOL> sys . stdout . write ( "<STR_LIT>" ) <EOL> Migrator . migrate ( <EOL> commit = options . get ( '<STR_LIT>' , False ) , <EOL> log_queries = options . get ( '<STR_LIT>' , False ) <EOL> ) <EOL> sys . stdout . write ( "<STR_LIT>" ) </s>
