Changeset 4536
- Timestamp:
- 02/17/07 00:01:17 (2 years ago)
- Files:
-
- django/trunk/django/core/mail.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/mail.py
r4065 r4536 9 9 import random 10 10 11 DNS_NAME = socket.getfqdn() # Cache the hostname 11 # Cache the hostname, but do it lazily: socket.getfqdn() can take a couple of 12 # seconds, which slows down the restart of the server. 13 class CachedDnsName(object): 14 def __str__(self): 15 return self.get_fqdn() 16 17 def get_fqdn(self): 18 if not hasattr(self, '_fqdn'): 19 self._fqdn = socket.getfqdn() 20 return self._fqdn 21 22 DNS_NAME = CachedDnsName() 12 23 13 24 class BadHeaderError(ValueError):
