App Engine Python SDK version 1.7.4 (2)
[gae.git] / python / lib / django_1_4 / django / core / mail / utils.py
blob322a3a1b79f9e4e9f2888e49e89161cff93ddc1c
1 """
2 Email message and email sending related helper functions.
3 """
5 import socket
8 # Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of
9 # seconds, which slows down the restart of the server.
10 class CachedDnsName(object):
11 def __str__(self):
12 return self.get_fqdn()
14 def get_fqdn(self):
15 if not hasattr(self, '_fqdn'):
16 self._fqdn = socket.getfqdn()
17 return self._fqdn
19 DNS_NAME = CachedDnsName()