1

There are several settings in my multi-themed/multi-site Mezzanine project that would be best served by independent (per theme) settings - items like BLOG_SLUG or GRAPPELLI_ADMIN_TITLE, for example. What is the best way to accomplish this in Mezzanine?

Thank you.

1 Answer 1

1

In order to set different settings for each app (theme) you need to create a defaults.py file inside your app folder (my_project/app/defaults.py).

Then you can use TEMPLATE_ACCESSIBLE_SETTINGS to hook the registered setting you created.

from mezzanine.conf import register_setting

register_setting(
    name="TEMPLATE_ACCESSIBLE_SETTINGS",
    description=("Sequence of setting names available within templates."),
    editable=True,
    default=("BLOG_SLOG_2",
             ),
    append=True,
)

register_setting(
    name="BLOG_SLOG_2",
    label="Blog Slug",
    description="The blog slug for theme 2.",
    editable=True,
    default="Default Blog Slug",
)

You can read more about it from their official documentation: http://mezzanine.jupo.org/docs/configuration.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.