=====
iprir
iprir is a simple Django app to store and query information about Regional
Internet Registries like Top Level Domains and IP adresses.
Useful if you'd like to know where your visitors come from.
Updated for Django2.0
Updated for PostgreSQL
Quick start
-
Add "iprir" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'iprir',
)
-
Include the iprir URLconf in your project urls.py like this::
url(r'^iprir/', include('iprir.urls')),
-
Run python manage.py migrate
to create the iprir models.
-
Run python manage.py loadregistry
to import data.
Usage
-
Any of the URL's
-
In models.py:
from iprir.models import TLD
class Country(models.Model):
...
tld = models.ForeignKey(TLD, blank=True, null=True)
-
In helpers.py / views.py
from iprir.helpers import ip_info
ipremote = ip_info(request, request.META['REMOTE_ADDR'])