@task
@needs('pavelib.prereqs.install_prereqs')
@consume_args
@timed
def check_settings(args):
 parser = argparse.ArgumentParser(prog='paver check_settings')
 parser.add_argument('system', type=str, nargs=1, help='lms or studio')
 parser.add_argument('settings', type=str, nargs=1, help='Django settings')
 args = parser.parse_args(args)
 system = args.system[0]
 settings = args.settings[0]
 try:
  import_cmd = "echo 'import {system}.envs.{settings}'".format(system=system, settings=settings)
  django_shell_cmd = django_cmd(system, settings, 'shell', '--plain', '--pythonpath=.')
  sh('{import_cmd} | {shell_cmd}'.format(import_cmd=import_cmd, shell_cmd=django_shell_cmd))
 except:
  print('Failed to import settings', file=sys.stderr)

@ task @ needs ( 'pavelib.prereqs.install_prereqs' ) @ consume_args @ timed def check_settings ( args ) : parser = argparse . ArgumentParser ( prog = 'paver check_settings' ) parser . add_argument ( 'system' , type = str , nargs = 1 , help = 'lms or studio' ) parser . add_argument ( 'settings' , type = str , nargs = 1 , help = 'Django settings' ) args = parser . parse_args ( args ) system = args . system [ 0 ] settings = args . settings [ 0 ] try : import_cmd = "echo 'import {system}.envs.{settings}'" . format ( system = system , settings = settings ) django_shell_cmd = django_cmd ( system , settings , 'shell' , '--plain' , '--pythonpath=.' ) sh ( '{import_cmd} | {shell_cmd}' . format ( import_cmd = import_cmd , shell_cmd = django_shell_cmd ) ) except : print ( 'Failed to import settings' , file = sys . stderr )
show the settings as redash sees them .