Firstly, I want to say that I'm a beginner in Django.
I'm looking for a simple way to retrieve the domain name of my Django website.
I want to do this in my settings.py. I've already tried with the socket something like this:
socket.gethostname()
but this doesn't work correctly.
If you have a request object,do
request.META['HTTP_HOST']
This would return the hostname