How to use Django to get the name for the host server?
I need the name of the hosting server instead of the client name?
I generally put something like this in settings.py:
settings.py
import socket try: HOSTNAME = socket.gethostname() except: HOSTNAME = 'localhost'
2.1m questions
2.1m answers
60 comments
57.0k users