Skip to main content

A Django app to log outgoing requests.

Project description

1 Welcome to django-ip-whitelist’s documentation!

Version:

0.1.3

Source:

https://github.com/maykinmedia/django-ip-whitelist

Keywords:

Django IP Whitelist, IP whitelist, pip package

PythonVersion:

3.9

Build status Code quality checks black Coverage status Documentation Status

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.

2 Installation

2.1 Requirements

  • Python 3.8 or above

  • setuptools 40.8.0 or above

  • Django 3.2 or newer

2.2 Install

pip install django-ip-whitelist

Add ip_whitelist to your INSTALLED_APPS:

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

3 Usage

Add the middleware to your MIDDLEWARE setting:

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

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

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

Add the WHITELIST_IP_RANGES to your settings.py:

WHITELIST_IP_RANGES = [
    ...
    '
    ...
]

Add the NO_AUTH_OUTSIDE_IP_ALLOWED_PATHS to your settings.py:

NO_AUTH_OUTSIDE_IP_ALLOWED_PATHS = [
    ...
    '/admin',
    ...
]

3.1 Migrations

Run the migrations:

python manage.py migrate

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ip-whitelist-0.1.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

django_ip_whitelist-0.1.3-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file django-ip-whitelist-0.1.3.tar.gz.

File metadata

  • Download URL: django-ip-whitelist-0.1.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/5.1.0 pkginfo/1.7.0 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.9.2

File hashes

Hashes for django-ip-whitelist-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d7ad41b399c412d93ea867210cecedf5da8d94effa09c92740f064c301a3c14f
MD5 bcc64be9f31dea5c01f5ae72cd7b0f6c
BLAKE2b-256 c845981de42be15b4cfd4441a643b3aee471de30cbb371c884432ee4fd095b41

See more details on using hashes here.

File details

Details for the file django_ip_whitelist-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: django_ip_whitelist-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/5.1.0 pkginfo/1.7.0 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.9.2

File hashes

Hashes for django_ip_whitelist-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 53b131a099d357229de5c2c3133793ac779f0c7723f4e99d92c9a5f2b10a91ff
MD5 65c829c916b926054d609bd506467a92
BLAKE2b-256 56280cedc9a3986acdc5ef2e0721ddbc29728d83810a0bd1ad4c52dffc1dc781

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page