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 with 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 the user can create an account on your Open edX platform. We will set this to false cause we don't want anybody to create an account on the platform (Client's wish).
So, to disable account creation we will set this flag to false in one of the setting files.
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 which value is being used by the platform for the ALLOW_PUBLIC_ACCOUNT_CREATION
feature flag. To check the value follow the below steps:
python manage.py lms shell --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 the 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!
Subscribe to my newsletter
Read articles from JayRam Nai directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
JayRam Nai
JayRam Nai
Open edX expert and open-source enthusiast.