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):
|
def log_visitor_location(ip_address):
|
||||||
# if ip_address in ['127.0.0.1', 'localhost']:
|
# if ip_address in ['127.0.0.1', 'localhost']:
|
||||||
# return
|
# return
|
||||||
if ip_address.startswith(('127.', '192.168.', '10.', '172.16.')):
|
if ip_address.startswith(('127.', '10.')):
|
||||||
VisitorLog.objects.create(
|
|
||||||
ip_address=ip_address,
|
print(f"DEBUG: Logged Skipped local IP {ip_address}")
|
||||||
country="Local Network",
|
|
||||||
city="Development Machine",
|
|
||||||
region="Home"
|
|
||||||
)
|
|
||||||
print(f"DEBUG: Logged local IP {ip_address}")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user