It depends on the handler you're using, but Django basically stores
whatever the server passes along for that value. The only exception is
the modpython handler which uses the server_hostname value from the
modpython request (also not an unreasonable choice).
The behaviour also depends upon the web server and how it's configured
(for example, whether you have a ServerName directive in a virtual host
section in Apache).
Regards,
Malcolm