Python Forum
Allow to Login if there is no IP Address
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allow to Login if there is no IP Address
#1
I Am new to Phyton coding, and i have question like, user will allow to login if there is no IP address found.

please find below and let me know is there any changes required and where..?

def get_location_object(ip_address):
 Try:
 Return GeoLite2IPLocation(ip_address=ip_address)
 except IpAddressLocationNotFound:
 Return  FreeGeoIPLocation(ip_address=ip_address)


 location = get_location_object(ip_address=self.ip_address)
 Logger.info(
{
 “login_credentials”: login_crendtials,
 “is_valid_user”: True if self.account else false,
“Country”: location.country,
“Description”: “LOGIN”,
}
)
Reply
#2
What's stopping you? I'm not familiar with the libraries it looks like you're using. Is your question about using them, or something outside of them?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  in a login interface when i try login with a user supposed to say test123 but nothing NullAdmin 3 2,256 Feb-20-2021, 04:43 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020