Tutor variables inside xBlock

While developing a xblock module i realised that i needed to access some of tutors configurations/variables that are inside config.yml, such as LMS_HOST and some custom ones added by my plugin. Is there a way to access these variables inside an xblock?

Since the whole xBlock tutorial is inside Open edX oficial page, there is nothing regarding Tutor stuff, not even in Tutor’s page.

There is no way to directly access Tutor settings from within xblocks. They simply live in different worlds.

But of course, the Tutor settings are used to generate application settings, and in particular Django settings. For instance, the Tutor LMS_HOST setting is used to generate the LMS_BASE and LMS_ROOT_URL Django settings. You can then write in your xblock:

from django.conf import settings
lms_host = settings.LMS_BASE

I’m curious, what xblock are you creating?

1 Like

It is a custom certificate xBlock. The thing is, we have both multi/single-tenant environments.