Last active
January 30, 2023 06:56
-
-
Save ppa-odoo/e7a45697cb87e5d34e3027f53fd5d56e to your computer and use it in GitHub Desktop.
Revisions
-
PRASHANT revised this gist
Mar 29, 2018 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,12 @@ from odoo.tools import config import os geofile = config.get('geoip_database') gio_data = GeoIP.open(geofile, GeoIP.GEOIP_STANDARD).record_by_addr('127.0.0.1') ================================================================================ https://www.whatismyip.com/what-is-my-public-ip-address/ https://github.com/odoo/iap-apps/blob/master-reveal-iap-dep/reveal_service/controllers/main.py https://packages.ubuntu.com/trusty/geoip-database-contrib https://github.com/maxmind/geoip-api-python/issues/20 https://pypi.python.org/pypi/geoip2 https://github.com/maxmind/geoip-api-python https://github.com/Xifax/goip-sms-bank/blob/master/manage.py -
PRASHANT created this gist
Mar 29, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ sudo add-apt-repository ppa:maxmind/ppa sudo apt update sudo apt install libgeoip1 libgeoip-dev geoip-bin sudo pip3 install GeoIP # For Python 3 sudo apt-get install geoip-database-contrib ================================================== import GeoIP geofile = config.get('geoip_database') gio_data = GeoIP.open(geofile, GeoIP.GEOIP_STANDARD).record_by_addr(ip) return gio_data Database Update : geoip-database-contrib_update ----------------------------------------------------------------------------------------------- import urllib import json import GeoIP from odoo.tools import config import os geofile = config.get('geoip_database') gio_data = GeoIP.open(geofile, GeoIP.GEOIP_STANDARD).record_by_addr('127.0.0.1')