def django_find_root_dir():
 from ...config import CONF
 manage_py = CONF['main_script']
 manage_dir = os.path.dirname(os.path.abspath(manage_py))
 settings_dir = None
 files = set(os.listdir(manage_dir))
 if ((('settings.py' in files) or ('settings' in files)) and ('urls.py' in files)):
  settings_dir = manage_dir
 else:
  for f in files:
   if os.path.isdir(os.path.join(manage_dir, f)):
    subfiles = os.listdir(os.path.join(manage_dir, f))
    if ((('settings.py' in subfiles) or ('settings' in subfiles)) and ('urls.py' in subfiles)):
     settings_dir = os.path.join(manage_dir, f)
     break
 return settings_dir

def django_find_root_dir ( ) : from ... config import CONF manage_py = CONF [ 'main_script' ] manage_dir = os . path . dirname ( os . path . abspath ( manage_py ) ) settings_dir = None files = set ( os . listdir ( manage_dir ) ) if ( ( ( 'settings.py' in files ) or ( 'settings' in files ) ) and ( 'urls.py' in files ) ) : settings_dir = manage_dir else : for f in files : if os . path . isdir ( os . path . join ( manage_dir , f ) ) : subfiles = os . listdir ( os . path . join ( manage_dir , f ) ) if ( ( ( 'settings.py' in subfiles ) or ( 'settings' in subfiles ) ) and ( 'urls.py' in subfiles ) ) : settings_dir = os . path . join ( manage_dir , f ) break return settings_dir
return path to directory that contains main django files .