[Answered ]-Django get sub domain from which the request was sent from

1👍

You can get subdomain name from HTTP_REFERER

from urllib.parse import urlparse

urlparse(request.META.get('HTTP_REFERER')).hostname.split('.')[0]
👤zOthix

Leave a comment