I am trying to use the geoip module on nginx and I think I have set everything up correctly, but my problem is the tutorial I am working with is in PHP and I am working with Python Flask.
This is the PHP:
<html>
<head>
<title>What is my IP address - determine or retrieve my IP address</title>
</head>
<body>
<?php
$country_code = getenv(GEOIP_COUNTRY_CODE);
echo "<br/>Your country : $country_code";
?>
</body>
</html>
Specifically this line:
$country_code = getenv(GEOIP_COUNTRY_CODE);
What would be the equvalent Python code to do the same thing? This is the tutorial I was working from if that helps: LINK
The equivalent python/flask code could be: