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_APPSINSTALLED_APPS = [ "...", "multi_domains", ]
-
Add middleware
"multi_domains.middleware.MultiDomainsMiddleware"to the beginning of theMIDDLEWAREMIDDLEWARE = [ "multi_domains.middleware.MultiDomainsMiddleware", "...", ]
-
Define the mapping of domain and urlconf
MULTI_DOMAINSMULTI_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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-multi-domains-0.0.1.tar.gz.
File metadata
- Download URL: django-multi-domains-0.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d22fbced3211ddc0d26e2674b36bb6ada93078e00384152db8b67ea5db42047
|
|
| MD5 |
dfc86406f7fc3e18d4c6692873d18998
|
|
| BLAKE2b-256 |
4628ac48accf223b9b8c6d216477733559cc86b542a0dfbb0c56bc0df71c52fc
|
File details
Details for the file django_multi_domains-0.0.1-py3-none-any.whl.
File metadata
- Download URL: django_multi_domains-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83e04e55e8439e2d24352b47f5628aace58d036335e2e941d2d698ef8b2a7a94
|
|
| MD5 |
e1416ae2200dfe69db630ba482c81983
|
|
| BLAKE2b-256 |
c42d2e05d833504e54468a210d22f7b950418cfd4b19f8614b2e96918ffee582
|