Change celery task function return values
Task results in the admin is not very useful...
submit_job_to_server returns a list of Models (
Result). Models are not serialisable to JSON by default... It fails...
So, I'm using in django settings:
CELERY_ACCEPT_CONTENT = ['pickle'] # also experimented with "json" alone and ['json','pickle'] as well CELERY_EVENT_SERIALIZER = 'pickle' CELERY_TASK_SERIALIZER = 'pickle' CELERY_RESULT_SERIALIZER = 'pickle'
However this renders the
Task results useless.
Do you have better ideas?
Otherwise I'd suggest in the
submit_job_to_server to return something else that could be readable... a list of files for example...