{ "info": { "author": "YunoJuno", "author_email": "code@yunojuno.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": ".. image:: https://badge.fury.io/py/django-geoip2-extras.svg\n :target: https://badge.fury.io/py/django-geoip2-extras\n\n.. image:: https://travis-ci.org/yunojuno/django-geoip2-extras.svg\n :target: https://travis-ci.org/yunojuno/django-geoip2-extras\n\n**The master branch of this project is now Python3 only. Python2 support is\nrestricted to the python2 branch.**\n\nDjango GeoIP2 Extras\n--------------------\n\nUseful extras based on the ``django.contrib.gis.geoip2`` module, using\nthe `MaxMind GeoIP2 Lite `_ database.\n\nThe first feature in this package is a Django middleware class that can\nbe used to add city, country level information to inbound requests.\n\nRequirements\n============\n\nThis package wraps the existing Django functionality, and as a result\nrelies on the same underlying requirements:\n\n *In order to perform IP-based geolocation, the GeoIP2 object requires the geoip2 Python library and the GeoIP Country and/or City datasets in binary format (the CSV files will not work!). Grab the GeoLite2-Country.mmdb.gz and GeoLite2-City.mmdb.gz files and unzip them in a directory corresponding to the GEOIP_PATH setting.*\n\nIn addition, the middleware follows the 'new' middleware pattern, and therefore\ndoes **not** support Django 1.9 or below. This is a 1.10 and above package.\n\nInstallation\n============\n\nThis package can be installed from PyPI as ``django-geoip2-extras``:\n\n.. code:: shell\n\n $ pip install django-geoip2-extras\n\nIf you want to add the country-level information to incoming requests, add the\nmiddleware to your project settings. NB The ``GeoIP2Middleware`` relies on the ``SessionMiddleware``, and must come after it:\n\n.. code:: python\n\n MIDDLEWARE = (\n ...,\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'geoip2_extras.middleware.GeoIP2Middleware',\n ...\n )\n\nThe middleware will not be active unless you add a setting for\nthe default ``GEOIP_PATH`` - this is the default Django GeoIP2 behaviour:\n\n.. code:: python\n\n # settings.py\n GEOIP_PATH = os.path.dirname(__file__)\n\nNB Loading this package does *not* install the `MaxMind database `_.\nThat is your responsibility. The Country database is 2.7MB, and could be added to most project comfortably, but it is updated regularly, and keeping that up-to-date is out of scope for this project. The City database is 27MB, and is probably not suitable for adding to source control. There are various solutions out on the web for pulling in the City database as part of a CD process.\n\nUsage\n=====\n\nOnce the middleware is added, you will be able to access City and / or Country level\ninformation on the request object:\n\n.. code:: python\n\n >>> request.geo_data.ip_address\n '1.2.3.4'\n >>> request.geo_data.city\n 'Beverley Hills'\n >>> request.geo_data.postal_code\n '90210'\n >>> request.geo_data.region\n 'California'\n >>> request.geo_data.country_code\n 'US'\n >>> request.geo_data.country_name\n 'United States'\n >>> request.geo_data.latitude\n '34.0736'\n >>> request.geo_data.longitude\n '118.4004'\n\nMissing / incomplete data will be None.\n\nIf the IP address cannot be found (e.g. '127.0.0.1'), then a default 'unknown'\ncountry is used, with a code of 'XX':\n\n.. code:: python\n\n >>> geo.ip_address\n '127.0.0.1'\n >>> geo.country_code\n 'XX'\n >>> geo.country_name\n 'unknown'\n >>> geo.is_unknown\n True\n\nThis prevents the middleware from re-requesting the address on each request - it effectively marks the IP as a bad address.\n\nTests\n=====\n\nThe project tests are run through ``tox``.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yunojuno/django-geoip2-extras", "keywords": "", "license": "MIT", "maintainer": "YunoJuno", "maintainer_email": "code@yunojuno.com", "name": "django-geoip2-extras", "package_url": "https://pypi.org/project/django-geoip2-extras/", "platform": "", "project_url": "https://pypi.org/project/django-geoip2-extras/", "project_urls": { "Homepage": "https://github.com/yunojuno/django-geoip2-extras" }, "release_url": "https://pypi.org/project/django-geoip2-extras/1.1.2/", "requires_dist": [ "Django (>=1.11)", "geoip2 (>=2.4)" ], "requires_python": "", "summary": "Additional functionality using the GeoIP2 database.", "version": "1.1.2" }, "last_serial": 5951052, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "6bb28dda66bd97323d4943dea8071950", "sha256": "29787ce9bf048b1aa59227748be76e7b806faadfb95112615287c747ce236cf1" }, "downloads": -1, "filename": "django_geoip2_extras-0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "6bb28dda66bd97323d4943dea8071950", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 31248, "upload_time": "2017-04-15T19:47:14", "url": "https://files.pythonhosted.org/packages/ea/97/93fc0c4b926a8636da093b369e5b10c47aec53e259b4d305e47a91441646/django_geoip2_extras-0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cdb7516a84f2e074bdf323fcdfb17232", "sha256": "ab747acb8d9339cc0f2fc27be64b439c4942ca25eaad76d3948370a28d2a7e89" }, "downloads": -1, "filename": "django-geoip2-extras-0.1.tar.gz", "has_sig": false, "md5_digest": "cdb7516a84f2e074bdf323fcdfb17232", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3518, "upload_time": "2017-04-15T19:47:12", "url": "https://files.pythonhosted.org/packages/8b/8a/db7a85ff5928f9afb9da795fc95c0d26f3d8c19a755b8a19eaadffafca16/django-geoip2-extras-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "abf0bc63e7d93c68c26461be45b91a4d", "sha256": "40e4939d93cb0396ad206fbcfbc1510ba3041fd053bfa05f34b1ab3c0ad9afa9" }, "downloads": -1, "filename": "django_geoip2_extras-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "abf0bc63e7d93c68c26461be45b91a4d", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 33585, "upload_time": "2017-04-16T09:50:19", "url": "https://files.pythonhosted.org/packages/ad/3d/b56cfba40761dc315a6657b21eb8b7bed181bb62de1720206bc8e13d4933/django_geoip2_extras-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a17c2ce3b72925731490d645f824f98", "sha256": "8b12fe0d929806bb355bbbeb6b241a57c80035a7c9f6d626be37d845591963aa" }, "downloads": -1, "filename": "django-geoip2-extras-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0a17c2ce3b72925731490d645f824f98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5527, "upload_time": "2017-04-16T09:50:17", "url": "https://files.pythonhosted.org/packages/94/b4/deeb690d0707b669f07d471a47be46c61b7f4ad5fab049ad40050737d744/django-geoip2-extras-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7ed578fc51ab16c496f63a3dcf38a78d", "sha256": "e52009dc24180da4efebff75b911f23b3e2b3fbbc5f32afcf6f3459bf1a3fa0b" }, "downloads": -1, "filename": "django_geoip2_extras-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "7ed578fc51ab16c496f63a3dcf38a78d", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8088, "upload_time": "2017-08-02T10:12:25", "url": "https://files.pythonhosted.org/packages/93/94/a5be5970d74c64a852096b8fc76a13e3bbe7dbb1bcab920abe73429805a5/django_geoip2_extras-0.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19261b166dd205c6b032f446bdaa2cea", "sha256": "83e64a6376cf591d138bd348185d3189e5ed190f356f14a68b734caa76291c0a" }, "downloads": -1, "filename": "django-geoip2-extras-0.1.2.tar.gz", "has_sig": false, "md5_digest": "19261b166dd205c6b032f446bdaa2cea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5614, "upload_time": "2017-08-02T10:12:23", "url": "https://files.pythonhosted.org/packages/65/a7/335be3aa0429b36c46ef1bcedfd3be67d72451029c1e28b0b77aee26789e/django-geoip2-extras-0.1.2.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "a1e16b00d244b5506d15a2af84ab21eb", "sha256": "66bbcd2b8ca075de00c302c529dfb36c6d22cde0cd6f275679a8ce4e4ee98acf" }, "downloads": -1, "filename": "django_geoip2_extras-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a1e16b00d244b5506d15a2af84ab21eb", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9268, "upload_time": "2018-01-02T16:06:57", "url": "https://files.pythonhosted.org/packages/63/80/588a7faa8faef315d35b8bb4f3f2e8515d52eb32902167edcd462238333a/django_geoip2_extras-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d8742825947427847d3ef49c85b8ee4a", "sha256": "6e5298426bc67a9af2d416b55d6ad07dd56f148b571f63a9996863e44e77c24c" }, "downloads": -1, "filename": "django-geoip2-extras-1.0.tar.gz", "has_sig": false, "md5_digest": "d8742825947427847d3ef49c85b8ee4a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6677, "upload_time": "2018-01-02T16:06:55", "url": "https://files.pythonhosted.org/packages/80/b5/569883de8758fb343ea16ae6c6f8b86881ad1e5782541b96bea61ed59562/django-geoip2-extras-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "091cf1734e951425ff74338acbd5379f", "sha256": "7105b002d873dbbb92f1b52b519e7865315b571683d7a44ef05e11b10e39cae2" }, "downloads": -1, "filename": "django_geoip2_extras-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "091cf1734e951425ff74338acbd5379f", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9510, "upload_time": "2018-01-02T18:01:47", "url": "https://files.pythonhosted.org/packages/8d/44/0751446d649eac6e1b0db6d34b2d2a39926059b4de5cc600023065876992/django_geoip2_extras-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1cc3057fc8ebcdefc19809bf51e37e12", "sha256": "dd3e974991ef91ff0002a45f4a5923dbfbf46f77b8615826396290feb16bd50f" }, "downloads": -1, "filename": "django-geoip2-extras-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1cc3057fc8ebcdefc19809bf51e37e12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6878, "upload_time": "2018-01-02T18:01:45", "url": "https://files.pythonhosted.org/packages/5e/6f/19cd326b08e9a2c564e9e1c2feb01c27451b6fdab6ad2337836a92ff15f6/django-geoip2-extras-1.0.1.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "ffbd7b84c6ee448dbfc2744dff436c40", "sha256": "c913c21b3901aacc7777937bb559a8aa9147573e8327870de9117c41716e0c19" }, "downloads": -1, "filename": "django_geoip2_extras-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ffbd7b84c6ee448dbfc2744dff436c40", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7868, "upload_time": "2019-10-03T11:16:04", "url": "https://files.pythonhosted.org/packages/65/fa/e9b58ee23cb58260a794d6d6d27d9fd4070ce457c5b6b7693ff6da5c0762/django_geoip2_extras-1.1-py3-none-any.whl" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "b0f5f34dc157546e9660dd1f617ba3f4", "sha256": "f00ea138aab51d84059fc8cfb9403218e33c1d199b6429b7de2f414eff480dd8" }, "downloads": -1, "filename": "django_geoip2_extras-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b0f5f34dc157546e9660dd1f617ba3f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7870, "upload_time": "2019-10-03T13:48:20", "url": "https://files.pythonhosted.org/packages/a2/a7/9e81deeb8a6e06bb13395572993ce323b291d3eec1fb17b5a788e8c28fbf/django_geoip2_extras-1.1.1-py3-none-any.whl" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "a47ed51b764fa781fced72d35ff9ac62", "sha256": "76f0cad071cb58e8d006b448707bcc760d571af8e804348603f2f4d1419c11c5" }, "downloads": -1, "filename": "django_geoip2_extras-1.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a47ed51b764fa781fced72d35ff9ac62", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7968, "upload_time": "2019-10-09T17:14:17", "url": "https://files.pythonhosted.org/packages/51/72/a4a70fdcdb68885f5639d8c450724746c552ab4a29158b23680d25106e95/django_geoip2_extras-1.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c91d309c73cfbb63786f186f00e3c12", "sha256": "5412d1d388e0a6eccf44f1a5717f44181f2c73a4c83300ab8480d50116215516" }, "downloads": -1, "filename": "django-geoip2-extras-1.1.2.tar.gz", "has_sig": false, "md5_digest": "5c91d309c73cfbb63786f186f00e3c12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7019, "upload_time": "2019-10-09T17:14:19", "url": "https://files.pythonhosted.org/packages/a3/34/dc42dd133e8098d8c3a3d49b004360d23a98bfd4e0758e1362a4f281f469/django-geoip2-extras-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a47ed51b764fa781fced72d35ff9ac62", "sha256": "76f0cad071cb58e8d006b448707bcc760d571af8e804348603f2f4d1419c11c5" }, "downloads": -1, "filename": "django_geoip2_extras-1.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a47ed51b764fa781fced72d35ff9ac62", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7968, "upload_time": "2019-10-09T17:14:17", "url": "https://files.pythonhosted.org/packages/51/72/a4a70fdcdb68885f5639d8c450724746c552ab4a29158b23680d25106e95/django_geoip2_extras-1.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c91d309c73cfbb63786f186f00e3c12", "sha256": "5412d1d388e0a6eccf44f1a5717f44181f2c73a4c83300ab8480d50116215516" }, "downloads": -1, "filename": "django-geoip2-extras-1.1.2.tar.gz", "has_sig": false, "md5_digest": "5c91d309c73cfbb63786f186f00e3c12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7019, "upload_time": "2019-10-09T17:14:19", "url": "https://files.pythonhosted.org/packages/a3/34/dc42dd133e8098d8c3a3d49b004360d23a98bfd4e0758e1362a4f281f469/django-geoip2-extras-1.1.2.tar.gz" } ] }