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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -