django-background-task icon indicating copy to clipboard operation
django-background-task copied to clipboard

Object of type 'WSGIRequest' is not JSON serializable

Open yaserrahimi opened this issue 6 years ago • 1 comments

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?

yaserrahimi avatar Jul 21 '18 07:07 yaserrahimi

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

RyabykinIlya avatar Jun 02 '20 18:06 RyabykinIlya