diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-09-14 07:12:47 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-09-14 07:12:47 +0000 |
| commit | 0863a634f3ddcbb6b20f6033844d70d28947f1ab (patch) | |
| tree | ad6a444a21ab4d7804af3a1753df1c00f3e20e33 | |
| parent | 20ecbbd9e749f7abd0a7ffcc61b01cb874846817 (diff) | |
Fixed #4951 -- Improved host retrieval in sites.models.RequestSite. Thanks, Caleb.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6174 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/sites/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/sites/models.py b/django/contrib/sites/models.py index 921cf4ff4d..18830dd3ae 100644 --- a/django/contrib/sites/models.py +++ b/django/contrib/sites/models.py @@ -1,5 +1,6 @@ from django.db import models from django.utils.translation import ugettext_lazy as _ +from django.http import get_host class SiteManager(models.Manager): def get_current(self): @@ -36,7 +37,7 @@ class RequestSite(object): The save() and delete() methods raise NotImplementedError. """ def __init__(self, request): - self.domain = self.name = request.META['SERVER_NAME'] + self.domain = self.name = get_host(request) def __unicode__(self): return self.domain |
