Skip to content

Django middleware to add country code information to requests using redis.

Notifications You must be signed in to change notification settings

muleros/django-redis-countries

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

django-redis-countries

Installation

Add redis_countries to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'redis_countries',
    ...
)

Add the RedisCountryCodeMiddleware to your MIDDLEWARE_CLASSES:

MIDDLEWARE_CLASSES = (
    ...
    'redis_countries.middleware.RedisCountryCodeMiddleware',
    ...
)

Usage

In order to user django-redis-countries you need to download the database

You can find it in http://dev.maxmind.com/geoip/legacy/geolite/

Download the CSV/ZIP version of the database called GeoLite Country and unzip it

TODO

  • Automatically download the appropiate database for MaxMind's website (Actually see if that is legal).
  • Add more information to the request objects
  • IPv6

About

Django middleware to add country code information to requests using redis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%