Para instalar o django-ipware
pip install django-ipware
>>> g.city('74.125.79.147')
{'city': 'Ackworth',
'region': 'IA',
'area_code': 970,
'longitude': -93.434700012207031,
'country_code3': 'USA',
'latitude': 41.363498687744141,
'postal_code': '50001',
'dma_code': 679,
'country_code': 'US',
'country_name': 'United States'}