1👍
✅
in settings.py, you can use socket.gethostname()
import socket
if 'subdomain' in socket.gethostname():
# set your subdomain
else:
# set your maindomain
another version:
if socket.gethostname().split('.')[0] in ['subdomain1', 'subdomain2', ..]:
# set socket.gethostname().split('.')[0] as subdomain
Source:stackexchange.com