{ "info": { "author": "Department for International Trade - Export team", "author_email": "tools@digital.trade.gov.uk", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.9", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=====================\nDjango IP Restriction\n=====================\n\nDepartment of International Trade Django IP Whitelist. A Django middleware to restrict incoming IPs to a Django project to a list of allowed IPs or IP ranges. Access to the admin login screen, and access to authenticated users are configurable, so it can be set such that users can authenticate, and bypass the IP restriction for the site.\n\nRequirements\n------------\n\n* Python >= 3.3\n* Django >= 1.9\n\n\n===========\nQuick start\n===========\n\n#. Install the package::\n\n $ pip install django-ip-restriction\n\n#. Add the middleware to your settings (Note: the minimum necessary other middleware components are Django's `SessionMiddleware` and `AuthenticationMiddleware`, these are added by default to your settings)::\n\n # Django 1.9\n MIDDLEWARE_CLASSES = [\n ...\n 'ip_restriction.IpWhitelister',\n ...\n ]\n\n # Django 1.10+\n MIDDLEWARE = [\n ...\n 'ip_restriction.IpWhitelister',\n ...\n ]\n\n\n=============\nConfiguration\n=============\n\nTurning on or off, and configuring the IP whitelist is done either via variables in your Django settings, or via environment variables. Values in Django settings take preference over values in the environment.\n\nTurning on/off the middleware is done via ``RESTRICT_IPS``, and the default value is False. Either set this variable to True in Django settings, or set a truthy value (e.g. 'true', '1') in your environment. \n\nIndividual IPs can be whitelisted via ``ALLOWED_IPS``, which is either a list of IP strings in Django settings, or a comma-separated list of IPs in the environment, e.g the following 2 are equivalent::\n\n # in bash (spaces are disregarded, trailing commas are OK)\n export ALLOWED_IPS='192.168.0.1, 192.168.0.2,192.168.0.3,'\n\n # in settings.py (will override the above environment variable)\n ALLOWED_IPS = ['192.168.0.1', '192.168.0.2', '192.168.0.3']\n\nIP ranges can be whitelisted via ``ALLOWED_IP_RANGES``, which is either a list of IP range strings (CIDR notation) in Django settings, or a comma-separated list of IP ranges in the environment, e.g.::\n\n # in bash\n export ALLOWED_IP_RANGES='192.168.0.0/8, 127.0.0.0/2'\n\n # in settings.py\n ALLOWED_IPS = ['192.168.0.0/8', '127.0.0.0/2']\n\nRegardless of the IP addresses/rages that are in the whitelist, access for all authenticated users can be allowed with ``ALLOW_AUTHENTICATED``. If true, this will allow any valid sessions past the IP restriction.\n\nRegardless of the IP addresses/rages that are in the whitelist, access to the admin URLs is also allowed past the IP restriction if ``ALLOW_ADMIN`` is true.\n\nSetting both ``ALLOW_ADMIN`` *and* ``ALLOW_AUTHENTICATED`` to true is recommended, and will allow any user that can log in, to first access only the admin interface in order to authenitcate, and from then have access to all URLs for the project.\n\n\nRestict Admin views only\n------------------------\n\nTo restrict admin views only set the variables ``RESTRICT_ADMIN_BY_IPS``, ``ALLOWED_ADMIN_IPS`` and ``ALLOWED_ADMIN_IP_RANGES``\n\n============\nContributing\n============\n\nContributions are welcome. Please follow the guidelines below to make life easier:\n\n* Fork the repo, branch off release, make changes, then make a pull request (PR) to release on the main repo\n* Include documentation for any new features\n* Please limit changes for a PR to a single feature, or a single bugfix\n - Make multiple PRs for multiple discrete changes\n* Please squash commits - ideally a single commit, but at least to a sensible minimum\n - If a PR reasonably should have multiple commits, consider if it should *actually* be separate PRs\n\n\n=======\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE `_ file for more\ndetails.\n\n\n====\nTODO\n====\n\n* Allow the IP restriction to work in a blacklisting mode, rather than just a whitelisting mode\n* Get continuous integration to run on multiple python versions from 3.0+ \n - Currently only running on 3.5.0\n - Utilise parallelism\n* Run tests on multiple Django versions\n - Currently only running against Django 1.9\n - Utilise parallelism\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/uktrade/dit-ip", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-ip-restriction", "package_url": "https://pypi.org/project/django-ip-restriction/", "platform": "", "project_url": "https://pypi.org/project/django-ip-restriction/", "project_urls": { "Homepage": "https://github.com/uktrade/dit-ip" }, "release_url": "https://pypi.org/project/django-ip-restriction/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "A Django middleware to restrict incoming IPs to a Django project.", "version": "1.1.1" }, "last_serial": 4909809, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "155cde0af22a903ed8ea68ea57aa5989", "sha256": "5a21ca031592b1c6d72ce4d5864ccf0530fbc1516fa645480508a027f413cf89" }, "downloads": -1, "filename": "django-ip-restriction-0.1.0.tar.gz", "has_sig": false, "md5_digest": "155cde0af22a903ed8ea68ea57aa5989", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4533, "upload_time": "2017-03-23T09:42:27", "url": "https://files.pythonhosted.org/packages/fd/83/15d2ba8179a482211817bbb9bd2926afa3d507b654d84bebf0e3d3c2b1ed/django-ip-restriction-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a9371902bf3224865ad5eec4f90e6e94", "sha256": "47e3d562a11268e9fd595c9dc6998b66d98850672ddb5dbcdc2d65dd6c7a840d" }, "downloads": -1, "filename": "django-ip-restriction-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a9371902bf3224865ad5eec4f90e6e94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4517, "upload_time": "2017-03-23T09:48:44", "url": "https://files.pythonhosted.org/packages/3d/d5/e8ab97771728d3810b1c72d25cc21b1fb21a26b228dbd99e409b9d7447d1/django-ip-restriction-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f7eee23de64fd9ea6b02cc69cf63ce7c", "sha256": "110f9e42b42828fdc67ebb1ee430f6a43391277312213272c7852f5ef5cbbea3" }, "downloads": -1, "filename": "django-ip-restriction-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f7eee23de64fd9ea6b02cc69cf63ce7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4522, "upload_time": "2017-03-23T09:51:41", "url": "https://files.pythonhosted.org/packages/d8/5d/e624f257174a368fa4e599f69108e2e5725eaff9cb3bbaaf42123a4b3c72/django-ip-restriction-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "23e04e96428114e1c63f1ce45f7743bf", "sha256": "010f00aaef28920e66d8175a6dd894acc9a5b85edab55c28aa529ec7a6c379ce" }, "downloads": -1, "filename": "django-ip-restriction-0.1.3.tar.gz", "has_sig": false, "md5_digest": "23e04e96428114e1c63f1ce45f7743bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4815, "upload_time": "2017-03-23T10:33:26", "url": "https://files.pythonhosted.org/packages/7b/53/8732428f43988e1b57489a60f719e6889f79047424c931262e5e697f9d17/django-ip-restriction-0.1.3.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "3f06696dd46f878547d0eacbaea88d21", "sha256": "816b1ad190399741291fc00da1aa9745cad2eaf6568ad11f84ab0a278c73c71b" }, "downloads": -1, "filename": "django-ip-restriction-0.9.0.tar.gz", "has_sig": false, "md5_digest": "3f06696dd46f878547d0eacbaea88d21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4824, "upload_time": "2017-03-23T10:47:00", "url": "https://files.pythonhosted.org/packages/19/e0/0b8b69847feafb3d9dd3da98f9c16bcea4b5d9ae0877cca36e5358e35565/django-ip-restriction-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "604180149fd666fa84bdd8aeb5f9e36f", "sha256": "9e4414a6c3c614635fcb647e0218cabce3c819d4003c2cf8cfd89ef7f6a29c5f" }, "downloads": -1, "filename": "django-ip-restriction-0.9.1.tar.gz", "has_sig": false, "md5_digest": "604180149fd666fa84bdd8aeb5f9e36f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7850, "upload_time": "2017-04-12T19:13:32", "url": "https://files.pythonhosted.org/packages/4a/a1/f0b052f286b2a691a491c48778f1d75fd7ce0438484022d17bac5858a427/django-ip-restriction-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "0d255ff45f0b8776f599e8a74c654e55", "sha256": "cea5a9a910b6d97f0da665dd752b550af0be90799be64fed78420b6b99a85eaf" }, "downloads": -1, "filename": "django-ip-restriction-0.9.2.tar.gz", "has_sig": false, "md5_digest": "0d255ff45f0b8776f599e8a74c654e55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7853, "upload_time": "2017-04-12T19:32:21", "url": "https://files.pythonhosted.org/packages/6e/63/774079ff3ef7074424b18be917a70b909a5f210f54880f61f96b965eeeca/django-ip-restriction-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "defacbfb3afd0eb61cd318bd9ec73ccd", "sha256": "87586fffd52db27d2bd78a9315e88f54284f394b84968820b117850127d8e2d1" }, "downloads": -1, "filename": "django-ip-restriction-0.9.3.tar.gz", "has_sig": false, "md5_digest": "defacbfb3afd0eb61cd318bd9ec73ccd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5155, "upload_time": "2017-05-30T10:05:51", "url": "https://files.pythonhosted.org/packages/52/b4/12d91620e75a6ca1dee4b032e57eb7768d83c463ba2e48e42a10b4740624/django-ip-restriction-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "e328c51c7a52076ccc6919f74e938569", "sha256": "bb74bd20b87b055d4bf18fb31ccd1d633044dbe695bb57d488fbee50193aa342" }, "downloads": -1, "filename": "django_ip_restriction-0.9.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e328c51c7a52076ccc6919f74e938569", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11845, "upload_time": "2017-08-22T17:08:20", "url": "https://files.pythonhosted.org/packages/05/0d/fb4d007d40d038bdad45b63105b36402ac76e4c31a02b4d774fa1c471c5b/django_ip_restriction-0.9.4-py3-none-any.whl" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "c500bfda834cf2ba7a305525ca71f25f", "sha256": "1ac882506f10efa486351c07ec9502b21fb00c2d5ed4b636a1a9cdc1065a6602" }, "downloads": -1, "filename": "django_ip_restriction-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c500bfda834cf2ba7a305525ca71f25f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11842, "upload_time": "2017-08-29T09:45:47", "url": "https://files.pythonhosted.org/packages/a5/94/4fb9f7a1830d0421b0b193bd836aaf98dfeb758576131cfa91b388659472/django_ip_restriction-1.0.0-py3-none-any.whl" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "53bd19e70915d02001662110cd15bd6e", "sha256": "860668282621d13f918e5677e85db13b906abdcbf563086da839e4eda0fa03f9" }, "downloads": -1, "filename": "django-ip-restriction-1.1.0.tar.gz", "has_sig": false, "md5_digest": "53bd19e70915d02001662110cd15bd6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5931, "upload_time": "2019-03-07T11:52:49", "url": "https://files.pythonhosted.org/packages/53/5d/ab689f8faf42dfcec6b6e655f96adb661853c0b2fe0f1fc81e0e8190dc1c/django-ip-restriction-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "e95ec71f6a6eeeaf38acf024be666a45", "sha256": "56808533162f9a193706eccbd954ddcd1643e0973f88e176ae5b297a92c56a27" }, "downloads": -1, "filename": "django_ip_restriction-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e95ec71f6a6eeeaf38acf024be666a45", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10561, "upload_time": "2019-03-07T11:52:48", "url": "https://files.pythonhosted.org/packages/55/49/d80e135baf4f5c8ef78766102ca61362a5c467ee3e1fab777b1e02e6f768/django_ip_restriction-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ed2db88d305bb7612cc7020b6208f82", "sha256": "8b10c2ef6de43f99d850c4e7bd0a984ebf82f65e8c6fff0de48e092ade7c8d93" }, "downloads": -1, "filename": "django-ip-restriction-1.1.1.tar.gz", "has_sig": false, "md5_digest": "0ed2db88d305bb7612cc7020b6208f82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5423, "upload_time": "2019-03-07T11:52:50", "url": "https://files.pythonhosted.org/packages/44/83/f35d56a19b6c2d44a31a6d3a0bb636b58e6b0b3843484334d00f2bf9c083/django-ip-restriction-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e95ec71f6a6eeeaf38acf024be666a45", "sha256": "56808533162f9a193706eccbd954ddcd1643e0973f88e176ae5b297a92c56a27" }, "downloads": -1, "filename": "django_ip_restriction-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e95ec71f6a6eeeaf38acf024be666a45", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10561, "upload_time": "2019-03-07T11:52:48", "url": "https://files.pythonhosted.org/packages/55/49/d80e135baf4f5c8ef78766102ca61362a5c467ee3e1fab777b1e02e6f768/django_ip_restriction-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ed2db88d305bb7612cc7020b6208f82", "sha256": "8b10c2ef6de43f99d850c4e7bd0a984ebf82f65e8c6fff0de48e092ade7c8d93" }, "downloads": -1, "filename": "django-ip-restriction-1.1.1.tar.gz", "has_sig": false, "md5_digest": "0ed2db88d305bb7612cc7020b6208f82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5423, "upload_time": "2019-03-07T11:52:50", "url": "https://files.pythonhosted.org/packages/44/83/f35d56a19b6c2d44a31a6d3a0bb636b58e6b0b3843484334d00f2bf9c083/django-ip-restriction-1.1.1.tar.gz" } ] }