This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This package provides an easy way to use maxmind's API to set an appropriate language code. This is useful, if we want to avoid using a language selector and cookies.


Firstly, install the package. Usage of pip is recommended:
pip install ip2language

Next, add the package to the INSTALLED_APPS setting:

Then we can add the middleware:

And it's important to add a setting to specify what language codes should be mapped to what language codes. This allows us to arbitrarily assign different fallbacks for different languages:
'NL': 'nl',
'BE': 'fr',
The keys in this dictionary should be a subset of the country codes supported by maxmind. For reference, this list can be viewed here:
The corresponding values can be any language code that's valid in the django project. The middleware will end up using this code in the redirect url.

Next, we will set a universal fallback:
This means that any visitor who is not in one of the specified countries, will view the content associated with the 'en' language code.

* geoip dat file loc
Lastly, we need to tell the module where it can find a valid geoip database:
GEOIP_DATABASE = '/usr/share/GeoIP.dat'

that's all folks!
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-ip2language-0.1.tar.gz (6.3 kB) Copy SHA256 Checksum SHA256 Source Apr 15, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting