Fixed #18349 -- Added ipv6 support to django.contrib.gis.geoip.

Thanks to j and fcurella for original patches.
possibly it would be worth refactoring this so as not to repeat the same pattern 4 times?