Use request.get_host rather than request.META['HTTP_HOST']