Under the hood

Data storage

All geoip data, including geography and geoip mapping is stored in the database. To avoid unnecessary database hits user location id is stored in a cookie.


Django-geoip supports only ipgeobase geography, which consist of following entities: Country, Region, City. Database maintains normalized relationships between all entities, i.e. Country has many Regions, Region has many Cities.

Database scheme

IP ranges


There is currently no infrastructure to use alternative geoip backends, but it’s planned for future releases. Pull requests are also welcome.

Ipgeobase backend

ipgeobase.ru is a database of russian and ukranian IP networks mapped to geographical locations.

It’s maintained by RuCenter and updated daily.

As of 30 June 2013 it contains info on 990 cities and 193666 Ip Ranges (some networks doesn’t belong to CIS).

Here a is demo of ip detection: http://ipgeobase.ru/