{"categories":[{"label":"WWW/HTTP","url":"https://skillfed.io/packages/category/internet-www-http/3"}],"enrichment":{"capability":"A Django middleware that extends ALLOWED_HOSTS validation to support CIDR IP ranges, allowing you to whitelist entire subnets instead of individual IP addresses.","skillfed_tags":["django-middleware","network-security","cidr-validation"],"use_cases":["Whitelist entire office or data-center subnets without listing every individual IP address","Allow requests from cloud provider IP ranges or load-balancer subnets in production environments","Restrict API access to specific network segments in multi-tenant or internal-only deployments","Simplify Host header validation when you control the network topology but not individual client IPs"],"what_it_does":"django-allow-cidr is a Django middleware that augments the standard ALLOWED_HOSTS validation by adding support for CIDR network ranges. Instead of listing individual IP addresses or hostnames, you define subnets using standard CIDR notation (e.g., 192.168.1.0/24) in an ALLOWED_CIDR_NETS setting, and the middleware validates incoming Host headers against both the traditional ALLOWED_HOSTS and your CIDR ranges. When ALLOWED_CIDR_NETS is configured, the middleware takes over Host header validation entirely, replacing ALLOWED_HOSTS with ['*'] internally to prevent Django's default validation from interfering.\n\nThe package uses Python's built-in ipaddress library for network validation, supports both IPv4 and IPv6, and works alongside normal ALLOWED_HOSTS entries. It is designed as a drop-in middleware that requires minimal configuration\u2014just add it to the top of your MIDDLEWARE list and define your CIDR ranges.","worth_installing":"Yes, if you need to validate Host headers against CIDR ranges. The middleware is straightforward, has no known vulnerabilities, carries a permissive license, and integrates cleanly with Django's standard security model. The aging maintenance status is not a blocker\u2014the package is stable, recently updated for current Django and Python versions, and solves a specific problem without heavy dependencies."},"id":"django-allow-cidr","links":{"html":"https://skillfed.io/packages/django-allow-cidr","md":"https://skillfed.io/packages/django-allow-cidr.md","pypi":"https://pypi.org/project/django-allow-cidr/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-04-08","license_spdx":null,"license_treatment":"permissive","name":"django-allow-cidr","python_support":"unspecified","summary":"A Django Middleware to enable use of CIDR IP ranges in ALLOWED_HOSTS."},"popularity":{"monthly_downloads":965054,"position":4624,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.8.0"}
