def add_metatag(tag="meta", **attrs): context.setdefault('metatags', []) context.metatags.append(Metatag(tag, **attrs))