I am trying to create a function that will return True
or False
depending on if the ip address of the user is an internal or external IP address. We would like internal users to be able to see more things and have more access. We're looking to do this as 'inexpensively' as possible. I know how to query the general IP and use conditional logic against a tuple. What I'm wondering is can Django do most of this for me?
Example:
if request.is_internal():
#Do Special Secret Internal Stuff Things!
I've read a bit about Django's INTERNAL_IPS but it seems to only be used for debugging, and will not allow me to call it. Am I wrong on that?