DEV Community

JayRam Nai
JayRam Nai

Posted on

How to check the value of your settings in open edX?

I am writing this post 'cause nowadays many of the devs are changing their settings in json / common.py / yml but the settings are not getting reflected on their open edX platform. So, in this post, I will not guide you about how to enable a particular setting but here I will be sharing the trick that How to check which settings are being used by the platform.

We will understand this by one example.

Suppose you want to enable/disable ALLOW_PUBLIC_ACCOUNT_CREATION Feature flag in your platform. By default, this Feature flag is set to true so that user can create account on your open edX platform. We will set this to false cause we don't want anybody to create an account in the platform (Client's wish).

So, to disable account creation we will set this flag to false in one of the setting file.

Now we will restart the LMS service to reflect the changes from the settings. But what we see on the platform, users are still able to register themselves on the platform.

It means that our changed value for the Feature flag is not being reflected on the platform (But we have set it to false already! Then why is this happening?).

Now, this is the time to check that which value is being used by the platform for the ALLOW_PUBLIC_ACCOUNT_CREATION feature flag. To check the value follow below steps:

python manage.py lms shell --settings <your settings>
from django.conf import settings
settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')

What we are doing here:

  • first we will open lms shell (just like Django shell)
  • import settings as we want to check the settings
  • get value for ALLOW_PUBLIC_ACCOUNT_CREATION feature flag

Here you will get the value of the ALLOW_PUBLIC_ACCOUNT_CREATION feature flag which is used by the platform. If it is still true then you have changed the wrong settings file, try to change it in another setting file. Change it until you get your changes in the shell. Once you see your changes in the shell then the feature or flag you have enabled or disabled will work properly.

I have checked here for the ALLOW_PUBLIC_ACCOUNT_CREATION feature flag only but you can check any of the settings like this.

I hope this will help!

Top comments (0)