In one of the model i have set one timestamp field as follows:
JavaScript
x
2
1
created_datetime = models.DateTimeField(auto_now_add = True)
2
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
JavaScript
1
2
1
created_datetime = models.DateTimeField(auto_now_add=True, auto_now=False)
2