drf-tracking icon indicating copy to clipboard operation
drf-tracking copied to clipboard

requested_at and remote_addr fields in base_model are not null

Open niubencoolboy opened this issue 5 years ago • 1 comments

In my case, when has IP white lists, the program can't get the remote_addr. But in the base_model, the field is setted to not null. remote_addr = models.GenericIPAddressField() the requested_at is the same. requested_at = models.DateTimeField(db_index=True)

niubencoolboy avatar Jun 24 '19 04:06 niubencoolboy

So, I changed the two codes to blew: from django.utils.timezone import now

requested_at = models.DateTimeField(default=now, db_index=True)

remote_addr = models.GenericIPAddressField(null=True, blank=True)

niubencoolboy avatar Jun 24 '19 04:06 niubencoolboy