Django Middleware for mapping domains to custom url confs.
Project description
django-multi-domains
This Django App sets specific URL Confs for configured domains.
After all, the app has only a small middleware.
Installation
pip install django-multi-domains
Setup
The following configurations should be added in the Django Settings Module.
-
Add
"multi_domains"
toINSTALLED_APPS
INSTALLED_APPS = [ "...", "multi_domains", ]
-
Add middleware
"multi_domains.middleware.MultiDomainsMiddleware"
to the beginning of theMIDDLEWARE
MIDDLEWARE = [ "multi_domains.middleware.MultiDomainsMiddleware", "...", ]
-
Define the mapping of domain and urlconf
MULTI_DOMAINS
MULTI_DOMAINS = { "api.example.com": "api.urls", "shop.example.com": "shop.urls", }
If no mapping is set for a domain, ROOT_URLCONF
is used as a fallback.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-multi-domains-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d22fbced3211ddc0d26e2674b36bb6ada93078e00384152db8b67ea5db42047 |
|
MD5 | dfc86406f7fc3e18d4c6692873d18998 |
|
BLAKE2b-256 | 4628ac48accf223b9b8c6d216477733559cc86b542a0dfbb0c56bc0df71c52fc |
Close
Hashes for django_multi_domains-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e04e55e8439e2d24352b47f5628aace58d036335e2e941d2d698ef8b2a7a94 |
|
MD5 | e1416ae2200dfe69db630ba482c81983 |
|
BLAKE2b-256 | c42d2e05d833504e54468a210d22f7b950418cfd4b19f8614b2e96918ffee582 |