django-cms / djangocms-frontend

django CMS frontend is a plugin bundle for django CMS providing several components for the frontend, currently implemented with the popular Bootstrap 5 framework.
Other
50 stars 21 forks source link

Link model settings for blog pages, cause: Name error, name '_' is not defined #34

Closed TLuesebrinck closed 2 years ago

TLuesebrinck commented 2 years ago

Removing the "_" fix this.

You have djangocms_blog installed. Consider adding the following lines to your settings.py:

DJANGOCMS_FRONTEND_LINK_MODELS = [
    {
        "type": _("Blog pages"),
        "class_path": "djangocms_blog.models.Post",
        "filter": {"publish": True, "app_config_id": 1},
        "search": "translations__title",
    },
]
fsbraun commented 2 years ago

True!

Better to add

from django.utils.translation import gettext_lazy as _