@task(aliases=['beat'])
def celery_beat(ctx, level='debug', schedule=None):
 os.environ['DJANGO_SETTINGS_MODULE'] = 'api.base.settings'
 cmd = 'celery beat -A framework.celery_tasks -l {0} --pidfile='.format(level)
 if schedule:
  cmd = (cmd + ' --schedule={}'.format(schedule))
 ctx.run(bin_prefix(cmd), pty=True)

@ task ( aliases = [ 'beat' ] ) def celery_beat ( ctx , level = 'debug' , schedule = None ) : os . environ [ 'DJANGO_SETTINGS_MODULE' ] = 'api.base.settings' cmd = 'celery beat -A framework.celery_tasks -l {0} --pidfile=' . format ( level ) if schedule : cmd = ( cmd + ' --schedule={}' . format ( schedule ) ) ctx . run ( bin_prefix ( cmd ) , pty = True )
run the celery process .