def create_profile(self, **kwargs): profile = Profile() # Raw Data profile.request = self.request profile.browscap = self.browscap.__dict__ # Platform profile.os = self.os() profile.ip = self.request["REMOTE_ADDR"] # Browser profile.browser = self.browser() profile.is_mobile = self.browscap.is_mobile() profile.http_protocol = self.request["SERVER_PROTOCOL"] if self.browscap.supports_java(): profile.java = "supported" if self.browscap.supports_javascript(): profile.javascript = "supported" if self.browscap.supports_iframes(): profile.iframes = "supported" if self.browscap.supports_frames(): profile.frames = "supported" if self.browscap.supports_tables(): profile.tables = "supported" if self.browscap.css_version() != 0: profile.css = "supported" profile.css_version = self.browscap.css_version() if "gzip" in self.request["HTTP_ACCEPT_ENCODING"].lower(): profile.gzip = "supported" profile.save(**kwargs) return profile