<s> import sys <EOL> from os import path as osp <EOL> this = osp . splitext ( osp . basename ( __file__ ) ) [ <NUM_LIT:0> ] <EOL> BASE_DIR = osp . dirname ( __file__ ) <EOL> from django . conf import settings <EOL> SETTINGS = dict ( <EOL> DATABASES = { '<STR_LIT:default>' : { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } } , <EOL> DEBUG = True , <EOL> TEMPLATE_DEBUG = True , <EOL> ROOT_URLCONF = this , <EOL> INSTALLED_APPS = ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> ) , <EOL> TEMPLATES = [ <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ <EOL> osp . join ( BASE_DIR , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ] <EOL> } <EOL> ] <EOL> ) <EOL> import django <EOL> from distutils . version import LooseVersion <EOL> django_version = django . get_version ( ) <EOL> if LooseVersion ( django_version ) < LooseVersion ( '<STR_LIT>' ) : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if LooseVersion ( django_version ) < LooseVersion ( '<STR_LIT>' ) : <EOL> del SETTINGS [ '<STR_LIT>' ] <EOL> SETTINGS [ '<STR_LIT>' ] = [ <EOL> osp . join ( BASE_DIR , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ] <EOL> if not settings . configured : <EOL> settings . configure ( ** SETTINGS ) <EOL> try : <EOL> from django . conf . urls import patterns <EOL> except ImportError : <EOL> patterns = lambda * x : list ( x [ <NUM_LIT:1> : ] ) <EOL> urlpatterns = patterns ( '<STR_LIT>' , ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> try : <EOL> from django . apps . registry import Apps <EOL> get_containing_app_config_orig = Apps . get_containing_app_config <EOL> def get_containing_app_config ( Apps_object , * args , ** kwargs ) : <EOL> Apps_object . apps_ready = True <EOL> return get_containing_app_config_orig ( Apps_object , * args , ** kwargs ) <EOL> Apps . get_containing_app_config = get_containing_app_config <EOL> except ImportError : <EOL> from django . db import models <EOL> get_app_orig = models . get_app <EOL> def get_app ( app_label , * a , ** kw ) : <EOL> if app_label == this : <EOL> return sys . modules [ __name__ ] <EOL> return get_app_orig ( app_label , * a , ** kw ) <EOL> models . get_app = get_app <EOL> from django . core import management <EOL> management . execute_from_command_line ( [ "<STR_LIT>" , "<STR_LIT:test>" , "<STR_LIT>" ] ) </s>
