Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-simple-ip-restrict

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-simple-ip-restrict

Apply an IP restriction to specific routes

  • 1.0.46
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc