python - Django - How to simply get domain name? -
this question has answer here:
firstly, want i'm beginner in django.
i'm looking simple way retrieve domain name of django website.
i want in settings.py. i've tried socket this:
socket.gethostname()
but doesn't work correctly.
if have request object,do
request.meta['http_host']
this return hostname
Comments
Post a Comment