2👍
✅
This should work. If it doesn’t work, check what is current ip address of the user and then check do you have that ip in your table where you record them. You should place this code right after you import module.
remote_status = self.request.META['REMOTE_ADDR']
rstat = ip_remote(remote_status)
if rstat == 500:
raise forms.ValidationError(
self.error_messages['Remote'],
code='Remote',
)
Source:stackexchange.com