{ "info": { "author": "Marco Westerhof", "author_email": "westerhof.marco@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Ip2Language\n===========\n\nThis 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.\n\n\n------------\nInstallation\n------------\n\nFirstly, install the package. Usage of pip is recommended:\n pip install ip2language\n\nNext, add the package to the INSTALLED_APPS setting:\n INSTALLED_APPS = (\n 'ip2language',\n ...\n )\n\nThen we can add the middleware:\n MIDDLEWARE_CLASSES = (\n 'ip2language.middleware.LanguagePreferenceMiddleware',\n ...\n )\n \nAnd 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:\n GEOIP_LANGUAGES = {\n 'NL': 'nl',\n 'BE': 'fr',\n }\nThe keys in this dictionary should be a subset of the country codes supported by maxmind. For reference, this list can be viewed here:\n http://dev.maxmind.com/geoip/codes/iso3166\nThe 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.\n\nNext, we will set a universal fallback:\n GEOIP_FALLBACK_LANGUAGE = 'en'\nThis means that any visitor who is not in one of the specified countries, will view the content associated with the 'en' language code.\n \n* geoip dat file loc\nLastly, we need to tell the module where it can find a valid geoip database:\n GEOIP_DATABASE = '/usr/share/GeoIP.dat'\n\nthat's all folks!", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "django-ip2language", "package_url": "https://pypi.org/project/django-ip2language/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-ip2language/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-ip2language/0.1/", "requires_dist": null, "requires_python": null, "summary": "A django module to derive a language code based on visitor IP", "version": "0.1" }, "last_serial": 789896, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f2087ea9633717b4e9d51d9b72e25bc1", "sha256": "dda7efd28963e4034631da5f2929e21f20d59f8343fdea2fc4dcc76061ae8569" }, "downloads": -1, "filename": "django-ip2language-0.1.tar.gz", "has_sig": false, "md5_digest": "f2087ea9633717b4e9d51d9b72e25bc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6270, "upload_time": "2013-04-15T09:55:05", "url": "https://files.pythonhosted.org/packages/a4/5c/a673f6586311212fb65920609595d673780dfa0e72cf55dc1a235366dbaa/django-ip2language-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f2087ea9633717b4e9d51d9b72e25bc1", "sha256": "dda7efd28963e4034631da5f2929e21f20d59f8343fdea2fc4dcc76061ae8569" }, "downloads": -1, "filename": "django-ip2language-0.1.tar.gz", "has_sig": false, "md5_digest": "f2087ea9633717b4e9d51d9b72e25bc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6270, "upload_time": "2013-04-15T09:55:05", "url": "https://files.pythonhosted.org/packages/a4/5c/a673f6586311212fb65920609595d673780dfa0e72cf55dc1a235366dbaa/django-ip2language-0.1.tar.gz" } ] }