{"categories":[{"label":"Dynamic Content","url":"https://skillfed.io/packages/category/internet-www-http-dynamic-content/2"}],"enrichment":{"capability":"Routes HTTP requests to different Django URL configurations based on the requested hostname, enabling a single Django project to serve multiple subdomains with distinct URL schemes.","skillfed_tags":["django-middleware","subdomain-routing","multi-tenant"],"use_cases":["Serve an API on api.example.com with its own URL structure separate from the main site.","Host a beta version at beta.example.com with different views and routes than production.","Route multiple branded subdomains to different content or applications within one Django project.","Implement multi-tenant deployments where each tenant's subdomain maps to its own URL configuration.","Separate admin interfaces, documentation, or internal tools onto dedicated subdomains."],"what_it_does":"django-hosts is a Django middleware package that intercepts incoming HTTP requests and routes them to different URL configurations based on the hostname. Instead of handling multiple subdomains within a single URLconf, you define separate hostconfs\u2014modules containing URL patterns\u2014and map hostnames (or patterns matching hostnames) to them. Requests to api.example.com route to one URLconf, beta.example.com to another, and unmatched hosts fall back to the default ROOT_URLCONF.\n\nThe package uses regular expressions to match hostnames against patterns, evaluated in order. It requires minimal configuration: add two middleware classes to your MIDDLEWARE setting, create a hosts.py file with your host patterns, and set ROOT_HOSTCONF and DEFAULT_HOST in settings. No runtime dependencies means a lightweight addition to any Django project.","worth_installing":"Yes. django-hosts is production-stable, actively maintained, has no external dependencies, and solves a common Django deployment pattern cleanly. Use it when you need to route multiple subdomains to different URL schemes within a single Django project\u2014it's the standard tool for this task."},"id":"django-hosts","links":{"html":"https://skillfed.io/packages/django-hosts","md":"https://skillfed.io/packages/django-hosts.md","pypi":"https://pypi.org/project/django-hosts/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-06-19","license_spdx":null,"license_treatment":"permissive","name":"django-hosts","python_support":"supports_current","summary":"Dynamic and static host resolving for Django. Maps hostnames to URLconfs."},"popularity":{"monthly_downloads":397715,"position":6956,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"7.0.0"}
