django-ip-whitelist


Namedjango-ip-whitelist JSON
Version 0.1.7 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-02-28 11:45:10
maintainer
docs_urlNone
authorMaykin Media
requires_python
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.7
: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": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ip,whitelist,django",
    "author": "Maykin Media",
    "author_email": "support@maykinmedia.nl",
    "download_url": "https://files.pythonhosted.org/packages/32/72/e847aa6c159853cdda6685a23323d691da31a6daf240c55b3698d1cd1564/django-ip-whitelist-0.1.7.tar.gz",
    "platform": null,
    "description": "Welcome to django-ip-whitelist's documentation!\n=================================================\n\n:Version: 0.1.7\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.7",
    "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": "553bb89aa1db469e4c3556eb50c009af72c5d4e4ff30ae07c10bdee5105af46d",
                "md5": "7e32b96f1b936aae65aaca008ab76dfd",
                "sha256": "0bb89239c3a3fad2d8612c56425432466c0a427e4ae17f902ed78e14c19f4d13"
            },
            "downloads": -1,
            "filename": "django_ip_whitelist-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7e32b96f1b936aae65aaca008ab76dfd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9025,
            "upload_time": "2024-02-28T11:45:08",
            "upload_time_iso_8601": "2024-02-28T11:45:08.609769Z",
            "url": "https://files.pythonhosted.org/packages/55/3b/b89aa1db469e4c3556eb50c009af72c5d4e4ff30ae07c10bdee5105af46d/django_ip_whitelist-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3272e847aa6c159853cdda6685a23323d691da31a6daf240c55b3698d1cd1564",
                "md5": "e90b12dc174af754a6f3ac2ee0644dd0",
                "sha256": "7229a9ac12eb14ac923d90f2b779c0cd0049cb52f1ea5568ed1f276039eb3efc"
            },
            "downloads": -1,
            "filename": "django-ip-whitelist-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "e90b12dc174af754a6f3ac2ee0644dd0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7509,
            "upload_time": "2024-02-28T11:45:10",
            "upload_time_iso_8601": "2024-02-28T11:45:10.987725Z",
            "url": "https://files.pythonhosted.org/packages/32/72/e847aa6c159853cdda6685a23323d691da31a6daf240c55b3698d1cd1564/django-ip-whitelist-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-28 11:45:10",
    "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.18949s