drf-tracking
drf-tracking copied to clipboard
requested_at and remote_addr fields in base_model are not null
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)
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)