local ip address removed from storing
This commit is contained in:
parent
b5b5be3007
commit
3d76637d84
@ -5,14 +5,9 @@ from .models import VisitorLog
|
||||
def log_visitor_location(ip_address):
|
||||
# if ip_address in ['127.0.0.1', 'localhost']:
|
||||
# return
|
||||
if ip_address.startswith(('127.', '192.168.', '10.', '172.16.')):
|
||||
VisitorLog.objects.create(
|
||||
ip_address=ip_address,
|
||||
country="Local Network",
|
||||
city="Development Machine",
|
||||
region="Home"
|
||||
)
|
||||
print(f"DEBUG: Logged local IP {ip_address}")
|
||||
if ip_address.startswith(('127.', '10.')):
|
||||
|
||||
print(f"DEBUG: Logged Skipped local IP {ip_address}")
|
||||
return
|
||||
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user