@task(rate_limit='60/m')
def render_document(pk, cache_control, base_url, force=False):
 document = Document.objects.get(pk=pk)
 if force:
  document.render_started_at = None
 try:
  document.render(cache_control, base_url)
 except Exception as e:
  subject = ('Exception while rendering document %s' % document.pk)
  mail_admins(subject=subject, message=e)
 return document.rendered_errors

@ task ( rate_limit = '60/m' ) def render_document ( pk , cache_control , base_url , force = False ) : document = Document . objects . get ( pk = pk ) if force : document . render_started_at = None try : document . render ( cache_control , base_url ) except Exception as e : subject = ( 'Exception while rendering document %s' % document . pk ) mail_admins ( subject = subject , message = e ) return document . rendered_errors
simple task wrapper for the render() method of the document model .