Django: how to get domain name? site framework doesn't work

software development

#1

I have tried to get the domain name in views.py with

but the result is empty string.
How to get domain name? is there other way?
is there a way to make site framework working fine for this?