django-seo2
django-seo2 copied to clipboard
populate_from does not work for literals
trafficstars
Documentation says it is possible to pass literal value as a default value for tags:
http://django-seo2.readthedocs.io/en/latest/reference/definition.html?highlight=default#populate_from
... but it does not work (the tag won't show up in the header):
class MyMetadata(seo.Metadata):
description = seo.MetaTag(max_length=155, populate_from='Default description')
but a callback works:
def default_description(metadata, **kwargs):
return "Default description"
default_description.short_description = "Standard description will be used"
class MyMetadata(seo.Metadata):
description = seo.MetaTag(max_length=155, populate_from=default_description)