I have this dictionary which I need to pass to another view, knowing that possible ways of doing that are either through sessions or cache, now when I am trying to pass to session it is throwing me an error that data is not JSON serializable probably because I have DateTime fields inside this dictionary
session_data = serializers.serialize('json',session_data)
error on above statement
'str' object has no attribute '_meta'
updated date is somewhat in this format
{'city_name': 'Srinagar', 'description': 'few clouds', 'temp': 26.74, 'feels_like': 27.07, 'max_temp': 26.74, 'min_temp': 26.74, 'sunrise': datetime.time(6, 11, 10), 'sunset': datetime.time(18, 43, 59)}
session_dataseems to be a string already, not a model object.serializers.serializeis supposed to be passed either a queryset or an iterable of model instances.