lilspikey / django-background-task

A database-backed work queue for Django
BSD 3-Clause "New" or "Revised" License
107 stars 200 forks source link

Object of type 'WSGIRequest' is not JSON serializable #24

Open yaserrahimi opened 6 years ago

yaserrahimi commented 6 years ago

my code:


@background(schedule=60)
def g_trends(request):
    get_trends()
    return HttpResponse('hello')

when i run code in django and i get to my url for that function i get this error: Object of type 'WSGIRequest' is not JSON serializable how can i fix it?

RyabykinIlya commented 4 years ago

do not send request as task argument. that object type does not JSON serializable, it can not be stored in database as argument