1. lorien
  2. django-ipgeo


django-ipgeo /

Filename Size Date modified Message
70 B
Initial commit
59 B
Initial commit
1.5 KB
Initial commit
0 B
Cleanup setup.py
640 B
Initial commit
56 B
Initial commit
875 B
Cleanup setup.py

django-ipgeo application

What is this?

django-ipgeo provides API to work with database from ipgeobase.ru

How to use it?

  • Install via pip django-ipgeo package.

  • Add "ipgeo" to INSTALLED_APPS

  • Run syncdb

  • Run "manage.py ipgeo_update"

  • Use it like:

    from ipgeo.models import Range


    rang = Range.objects.find(request.META['REMOTE_ADDR']

    except Range.DoesNotExist:

    print 'Unknown location'


    print 'The country is', rang.country if rang.location:

    print 'The city is', rang.location.name