django-ip-whitelist


Namedjango-ip-whitelist JSON
Version 0.1.10 PyPI version JSON
download
home_pagehttps://github.com/maykinmedia/django-ip-whitelist
SummaryA Django app to only allow access to certain pages based on IP addresses.
upload_time2024-08-14 13:00:54
maintainerNone
docs_urlNone
authorMaykin Media
requires_pythonNone
licenseMIT
keywords ip whitelist django
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Welcome to django-ip-whitelist's documentation!
=================================================

:Version: 0.1.10
:Source: https://github.com/maykinmedia/django-ip-whitelist
:Keywords: ``Django IP Whitelist, IP whitelist, pip package``
:PythonVersion: 3.9

|build-status| |code-quality| |black| |coverage| |docs|

|python-versions| |django-versions| |pypi-version|

This package provides a Django middleware that allows you to whitelist IP addresses that are allowed to access your site.

By default the user's IP needs to conform to the IP whitelist in order to access the Django admin. You can either specify individual IP addresses or IP ranges, and the whitelist is manageable via the Django admin.

.. contents::

.. section-numbering::



Installation
============

Requirements
------------

* Python 3.8 or above
* setuptools 40.8.0 or above
* Django 3.2 or newer


Install
-------

.. code-block:: bash

    pip install django-ip-whitelist

Add ``ip_whitelist`` to your ``INSTALLED_APPS``:

.. code-block:: python

    INSTALLED_APPS = [
        ...
        'ip_whitelist',
        ...
    ]


Usage
=====
Add the middleware to your ``MIDDLEWARE`` setting:

.. code-block:: python

    MIDDLEWARE = [
        ...
        'ip_whitelist.middleware.IPWhitelistMiddleware',
        ...
    ]

Add the IP addresses you want to whitelist to your ``settings.py``:

.. code-block:: python

    WHITELIST_IPS = [
        ...
        '127.0.0.1',
        ...
    ]

Add the WHITELIST_IP_RANGES to your ``settings.py``:

.. code-block:: python

    WHITELIST_IP_RANGES = [
        ...
        '
        ...
    ]

Add the OUTSIDE_IP_DISALLOWED_PATHS to your ``settings.py`` with disallowed URLs:

.. code-block:: python

    OUTSIDE_IP_DISALLOWED_PATHS = (
        ...
        '/admin',
        ...
    )


Migrations
----------

Run the migrations:

.. code-block:: bash

    python manage.py migrate



.. |build-status| image:: https://github.com/maykinmedia/django-ip-whitelist/workflows/Run%20CI/badge.svg
    :alt: Build status
    :target: https://github.com/maykinmedia/django-ip-whitelist/actions?query=workflow%3A%22Run+CI%22

.. |code-quality| image:: https://github.com/maykinmedia/django-ip-whitelist/workflows/Code%20quality%20checks/badge.svg
     :alt: Code quality checks
     :target: https://github.com/maykinmedia/django-ip-whitelist/actions?query=workflow%3A%22Code+quality+checks%22

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black

.. |coverage| image:: https://codecov.io/gh/maykinmedia/django-ip-whitelist/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/maykinmedia/django-ip-whitelist
    :alt: Coverage status

.. |docs| image:: https://readthedocs.org/projects/django-ip-whitelist/badge/?version=latest
    :target: https://django-ip-whitelist.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. |python-versions| image:: https://img.shields.io/pypi/pyversions/django-ip-whitelist.svg

.. |django-versions| image:: https://img.shields.io/pypi/djversions/django-ip-whitelist.svg

.. |pypi-version| image:: https://img.shields.io/pypi/v/django-ip-whitelist.svg
    :target: https://pypi.org/project/django-ip-whitelist/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/maykinmedia/django-ip-whitelist",
    "name": "django-ip-whitelist",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "ip, whitelist, django",
    "author": "Maykin Media",
    "author_email": "support@maykinmedia.nl",
    "download_url": "https://files.pythonhosted.org/packages/75/bd/b0f448b8d0ace79626c3a663d04e95354c87f8cf16f4d6b1d65b2dbe5c6c/django_ip_whitelist-0.1.10.tar.gz",
    "platform": null,
    "description": "Welcome to django-ip-whitelist's documentation!\n=================================================\n\n:Version: 0.1.10\n:Source: https://github.com/maykinmedia/django-ip-whitelist\n:Keywords: ``Django IP Whitelist, IP whitelist, pip package``\n:PythonVersion: 3.9\n\n|build-status| |code-quality| |black| |coverage| |docs|\n\n|python-versions| |django-versions| |pypi-version|\n\nThis package provides a Django middleware that allows you to whitelist IP addresses that are allowed to access your site.\n\nBy default the user's IP needs to conform to the IP whitelist in order to access the Django admin. You can either specify individual IP addresses or IP ranges, and the whitelist is manageable via the Django admin.\n\n.. contents::\n\n.. section-numbering::\n\n\n\nInstallation\n============\n\nRequirements\n------------\n\n* Python 3.8 or above\n* setuptools 40.8.0 or above\n* Django 3.2 or newer\n\n\nInstall\n-------\n\n.. code-block:: bash\n\n    pip install django-ip-whitelist\n\nAdd ``ip_whitelist`` to your ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        ...\n        'ip_whitelist',\n        ...\n    ]\n\n\nUsage\n=====\nAdd the middleware to your ``MIDDLEWARE`` setting:\n\n.. code-block:: python\n\n    MIDDLEWARE = [\n        ...\n        'ip_whitelist.middleware.IPWhitelistMiddleware',\n        ...\n    ]\n\nAdd the IP addresses you want to whitelist to your ``settings.py``:\n\n.. code-block:: python\n\n    WHITELIST_IPS = [\n        ...\n        '127.0.0.1',\n        ...\n    ]\n\nAdd the WHITELIST_IP_RANGES to your ``settings.py``:\n\n.. code-block:: python\n\n    WHITELIST_IP_RANGES = [\n        ...\n        '\n        ...\n    ]\n\nAdd the OUTSIDE_IP_DISALLOWED_PATHS to your ``settings.py`` with disallowed URLs:\n\n.. code-block:: python\n\n    OUTSIDE_IP_DISALLOWED_PATHS = (\n        ...\n        '/admin',\n        ...\n    )\n\n\nMigrations\n----------\n\nRun the migrations:\n\n.. code-block:: bash\n\n    python manage.py migrate\n\n\n\n.. |build-status| image:: https://github.com/maykinmedia/django-ip-whitelist/workflows/Run%20CI/badge.svg\n    :alt: Build status\n    :target: https://github.com/maykinmedia/django-ip-whitelist/actions?query=workflow%3A%22Run+CI%22\n\n.. |code-quality| image:: https://github.com/maykinmedia/django-ip-whitelist/workflows/Code%20quality%20checks/badge.svg\n     :alt: Code quality checks\n     :target: https://github.com/maykinmedia/django-ip-whitelist/actions?query=workflow%3A%22Code+quality+checks%22\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n\n.. |coverage| image:: https://codecov.io/gh/maykinmedia/django-ip-whitelist/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/maykinmedia/django-ip-whitelist\n    :alt: Coverage status\n\n.. |docs| image:: https://readthedocs.org/projects/django-ip-whitelist/badge/?version=latest\n    :target: https://django-ip-whitelist.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. |python-versions| image:: https://img.shields.io/pypi/pyversions/django-ip-whitelist.svg\n\n.. |django-versions| image:: https://img.shields.io/pypi/djversions/django-ip-whitelist.svg\n\n.. |pypi-version| image:: https://img.shields.io/pypi/v/django-ip-whitelist.svg\n    :target: https://pypi.org/project/django-ip-whitelist/\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Django app to only allow access to certain pages based on IP addresses.",
    "version": "0.1.10",
    "project_urls": {
        "Bug Tracker": "https://github.com/maykinmedia/django-ip-whitelist/issues",
        "Homepage": "https://github.com/maykinmedia/django-ip-whitelist",
        "Source Code": "https://github.com/maykinmedia/django-ip-whitelist"
    },
    "split_keywords": [
        "ip",
        " whitelist",
        " django"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "963a3180f22555a1b37ad8d5d85c15f368a94a3ce460bbdc7860758cc0bb9b6a",
                "md5": "5bb4f3be27855f4fa22db4c42c736bb9",
                "sha256": "a7796e576f0c73df70c4d25db410948525c09e22e4b349eafb7cc8d88c7f5be7"
            },
            "downloads": -1,
            "filename": "django_ip_whitelist-0.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5bb4f3be27855f4fa22db4c42c736bb9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9437,
            "upload_time": "2024-08-14T13:00:53",
            "upload_time_iso_8601": "2024-08-14T13:00:53.350330Z",
            "url": "https://files.pythonhosted.org/packages/96/3a/3180f22555a1b37ad8d5d85c15f368a94a3ce460bbdc7860758cc0bb9b6a/django_ip_whitelist-0.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "75bdb0f448b8d0ace79626c3a663d04e95354c87f8cf16f4d6b1d65b2dbe5c6c",
                "md5": "5ce0dd30d225a1d9c3677998ec7a4ad6",
                "sha256": "26087807fc5a65ccad3017cb3a7483b5bbfa17a6d8f7d4885d4f2369de6ac368"
            },
            "downloads": -1,
            "filename": "django_ip_whitelist-0.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "5ce0dd30d225a1d9c3677998ec7a4ad6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7797,
            "upload_time": "2024-08-14T13:00:54",
            "upload_time_iso_8601": "2024-08-14T13:00:54.723848Z",
            "url": "https://files.pythonhosted.org/packages/75/bd/b0f448b8d0ace79626c3a663d04e95354c87f8cf16f4d6b1d65b2dbe5c6c/django_ip_whitelist-0.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-14 13:00:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "maykinmedia",
    "github_project": "django-ip-whitelist",
    "github_not_found": true,
    "lcname": "django-ip-whitelist"
}
        
Elapsed time: 0.63348s