I'm trying to show a message using Django message, but this alert should be executed when a certain event happened on @shared_task. This is my celery function code in tasks.py
def show_message_in_time(self,response):
while True:
# get_info_to_show() this function will do something
messages.info(response, 'Your email is added successfully!')
sleep(2*60)
and this is the function on views.py
def index(response):
show_message_in_time.delay(response)
return render(response, "Sales.html", {'zipped_list': objs})
Below is the error I received
Exception Value:
Object of type 'WSGIRequest' is not JSON serializable
I have tried to convert WSGIRequest to JSON and also that's not working. Any help would be appreciated!