I’ve published 2 template tags for use with GeoIP at geoip.py.
Hope they may be of use…
Usage:
# Templatetag get_country_name returns the client’s country code
#
# Example:
# {% ifequal get_country “GB” %}
# do something
# {% endifequal %}
# Templatetag get_country sets the given variable name
# to the client’s country code
#
# Example:
# {% get_country as my_country %}
# {% ifequal my_country “GB” %}
# do something
# {% endifequal %}
That’s a nice and useful template tag, but you should also mention, what GeoIP is and where to get it.
Of course, everybody can google for it, but it would be just more convenient to get from one place.
very useful! thank youuu!!
Sweet! Just what I’ve been looking for.
Thanks for sharing.
GeoIP is the ip location technology by MaxMind
I added something on my blog about country detection in Django from IP without using Maxmind.
http://boomby.com/?p=3