#NEWLINE# def load_app( self , app_path , app_full_name = None ) : #NEWLINE# #INDENT# logger = log #NEWLINE# wsgidapp_path = os . path . dirname ( app_path ) #NEWLINE# extra = self . _load_django_extra_options ( wsgidapp_path ) #NEWLINE# site_name = self . _first_djangoproject_dir ( app_path ) #NEWLINE# os . environ [ 'DJANGO_SETTINGS_MODULE' ] = '{0}.settings' . format ( site_name ) #NEWLINE# logger . debug ( 'Using DJANGO_SETTINGS_MODULE = {0}' . format ( os . environ [ 'DJANGO_SETTINGS_MODULE' ] ) ) #NEWLINE# new_syspath = os . path . join ( app_path , site_name ) #NEWLINE# logger . debug ( 'Adding {0} to sys.path' . format ( app_path ) ) #NEWLINE# sys . path . append ( app_path ) #NEWLINE# logger . debug ( 'Adding {0} to sys.path' . format ( new_syspath ) ) #NEWLINE# sys . path . append ( new_syspath ) #NEWLINE# settings . _some_value = True #NEWLINE# del settings . _some_value #NEWLINE# for ( k , v ) in extra . items ( ) : #NEWLINE# #INDENT# setting_value = None #NEWLINE# if hasattr ( settings , k ) : #NEWLINE# #INDENT# setting_value = getattr ( settings , k ) #NEWLINE# #UNINDENT# if ( isinstance ( v , dict ) and setting_value and isinstance ( setting_value , dict ) ) : #NEWLINE# #INDENT# for ( k2 , v2 ) in v . items ( ) : #NEWLINE# #INDENT# getattr ( settings , k ) [ k2 ] = v2 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( v , list ) and setting_value and isinstance ( setting_value , list ) ) : #NEWLINE# #INDENT# setting_value += v #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( v , list ) and setting_value and isinstance ( setting_value , tuple ) ) : #NEWLINE# #INDENT# setattr ( settings , k , ( setting_value + tuple ( v ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# setattr ( settings , k , v ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# import django.core.handlers.wsgi #NEWLINE# return django . core . handlers . wsgi . WSGIHandler ( )