Ticket #4951: models.diff

File models.diff, 684 bytes (added by Caleb <jtxx000@…>, 17 years ago)
  • models.py

     
    11from django.db import models
    22from django.utils.translation import ugettext_lazy as _
     3from django.http import get_host
    34
    45class SiteManager(models.Manager):
    56    def get_current(self):
     
    3637    The save() and delete() methods raise NotImplementedError.
    3738    """
    3839    def __init__(self, request):
    39         self.domain = self.name = request.META['SERVER_NAME']
     40        self.domain = self.name = get_host(request)
    4041
    4142    def save(self):
    4243        raise NotImplementedError('RequestSite cannot be saved.')
Back to Top