Now the task queue is working fine. I have another problem. I am
generating a csv file.. Now since its running at background there will
not be any popup so I want to attach the file as an attachment in mail
and send or store the file in blobstore and send the link to user.

This is my code:

def report_download(result, colnames):
    import cStringIO
    stream = cStringIO.StringIO()
    logging.info('Before sending to render_report_csv')
    render_report_csv(stream, result, colnames=colnames)
    logging.info('After render_report_csv')
    filename = '%s-%s-%s.csv' % (request.function, request.args(0),
request.now)
    logging.info(filename)
    response.headers['Content-Type'] = 'text/csv'
    response.headers['Content-Disposition'] = 'attachment; filename=
%s' % filename
    logging.info('print stream')
    mail.send(to='rohit.agumbe.ram...@accenture.com', subject='Report
Download',message='')

    return stream.getvalue()

please suggest me on how to attach the csv to mail or get the blob url
of file stored in blob

Thanks

On Feb 14, 9:08 pm, Christian Foster Howes <how...@umich.edu> wrote:
> what is the error in the logs when the task fails?  what is the URL
> shown in the task list?  something is either amok with the URL itself,
> or something is causing that function to fail when called via the task
> queue.
>
> On 2/13/12 20:05 , Saurabh S wrote:
>
>
>
> > It worked when I passed a different controller in the url other than
> > the one it is being called from.
>
> > It is production.
> > I checked the task queue it simply retries continuously if the same
> > controller is provided.
> > No params is not a mandatory argument to takqueue.add() I guess.
> > Because it does not throw any syntax error if not provided.
>
> > On Feb 10, 8:52 pm, howesc<how...@umich.edu>  wrote:
> >> some questions/thoughts:
>
> >>   - local test server or production?
> >>   - did you check the task queue?  in production go to the admin console 
> >> and
> >> find the task queues link.  in local test go to /_ah/admin and find the
> >> task queue link
> >>   - is params a required argument to taskqueue.add()?  i don't know if i
> >> always use it cause i need it or cause it is required.

Reply via email to