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

requested_at and remote_addr fields in base_model are not null

Open lingster opened this issue 5 years ago • 0 comments

copied over from: https://github.com/aschn/drf-tracking/issues/141

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 Author niubencoolboy commented on 24 Jun 2019

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)

lingster avatar Mar 10 '20 22:03 lingster