Django views always have a request which has the Host header. This will contain the full subdomain the tenant is using.
We will add some utility methods to do this. Create a utils.py and add this code.

Views, whether they are Django function based, class based or a Django Rest Framework view have access to the request.
Lets take the example of polls.views.PollViewSet to limit the endpoints to tenant specific Poll objects.