def placekitten(width, height): """ Creates an image of a random kitten at the provided width and height. Usage format: {% placekitten [width] [height] %} Example usage: Color image at 250 wide and 400 high {% placekitten 250 400 %} """ url = get_placekitten_url(width, height) return format_html('<img src="{}"/>', url)
def render(self, context): return get_placekitten_url( self.width, self.height, color=self.color )
def render(self, context): return '<img src="%s"/>' % get_placekitten_url(self.width, self.height, color=self.color)