Skip to main content

django-simple-ip-restrict

This middleware allows you to mark Django URL namespaces as unavailable to all requests except those coming from a whitelisted IP subnet.

Instructions

Add to the list of MIDDLEWARE:

"django_simple_ip_restrict.middleware.ip_filter",

Then you can set the following keys on settings.py:

  • IP_PROTECTED_NAMESPACES: list of namespaces to block (default: ["admin"])
  • IP_NETWORKS_WHITELIST: list of subnets to allow, in CIDR notation

Manual deployment

Since we don't have a CI/CD pipeline set up right now. You'll have to follow the following steps to release

  1. Do your changes
  2. Install bumpversion and twine
pip install twine bumpversion
  1. Bump the version using bumpversion
bumpversion patch
  1. A commit should be made automatically, just push
git push
  1. Build using setup.py
python setup.py sdist
  1. Push to pypi using twine
twine upload dist/*

Use 1password to find the credentials for pypi.

In order to upload, we have 2FA and the following needs to be done:

  • username should be "__token__"
  • password should be the Access Token value

Metadata

Release files for django-simple-ip-restrict 1.0.46

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-simple-ip-restrict 1.0.46
File Size Uploaded Provenance
django_simple_ip_restrict-1.0.46.tar.gz 3.2 kB Without provenance Details

Release files / django_simple_ip_restrict-1.0.46.tar.gz

Download URL django_simple_ip_restrict-1.0.46.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e0f70f7e548071776186b41bf65ea335cbfd29a63dd02c35f1c3db1d8f181a5a
BLAKE2b-256 checksum
How to use checksums
aa1029e38db3bd5179254bd603640702e98b86e86672cc8ebb7591321eba8591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Security for django-simple-ip-restrict 1.0.46

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page