Hi All,migrating existing piston based Django api to REST framework api, it
works in dev environment but once moved to QA withÂ
django.contrib.auth.backends.RemoteUserBackend enabled in settings, getting the
following error
raise TypeError(f'Object of type {o.__class__.__name__} 'TypeError: Objec
> On Aug 3, 2018, at 07:18, Anusha Kommineni
> wrote:
> TypeError: datetime.datetime(2018, 2, 12, 0, 0, tzinfo=) is not JSON
> serializable
The error means what it says; there is no default way of serializing a datetime
into JSON. You can use the DjangoJSONEncoder, which does allow serializ
You can use unix timestamp, It's json serializable and can be converted to
a datetime object. If I am not wrong you were trying to store it in a
session? try this.
import time
timestamp=time.time()
request.session['current time']= timestamp
import datetime
datetime.datetime.fromtimestamp(request
Hi Anusha,
It seems you're trying to generate a JSON of some object/dictionary with a
Datetime in it. Datetimes are not serializable 'cause there is no date/time
representation in JSON (maybe epoch, but that's not the default).
On Fri, Aug 3, 2018 at 11:18 AM, Anusha Kommineni <
anushakommineni..
Hi,
I am getting below error.Can anyone help me?
TypeError: datetime.datetime(2018, 2, 12, 0, 0, tzinfo=) is not JSON
serializable
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails fro
5 matches
Mail list logo