In one of the model i have set one timestamp field as follows:
created_datetime = models.DateTimeField(auto_now_add = True)
While in shell i am able to create a obj and save it, however in my application it is raising a exception that created_datetime field cannot be null.
Confused where things went wrong!! How to reslove it.
Advertisement
Answer
You can do something like this
created_datetime = models.DateTimeField(auto_now_add=True, auto_now=False)