Settings - OmnipreneurshipAcademy/edx-platform GitHub Wiki
Settings for edX-platform
This page contains all the settings required for the edX-platform.
Enable ADG theme:
- Refer to the devstack readme to enable the theme for ADG.
Enable SSO OAuth:
- Go to the created app or create one (if one does not already exists) from the social app developer console e.g LinkedIn App, Google API dashboard and create credentials i.e API key and secret. Current credentials for both Google and LinkedIn can be found here.
- In addition to the credentials, we also need to add the redirect URIs so that the target social app recognizes our urls when the authentication request is made. Eg In the case of Google, we would need to add <example-url>/auth/complete/google-oauth2/ in the redirect uri list for it to work with <example-url>.
- Go to the admin panel and add a new Provider Configuration (OAuth) under the THIRD-PARTY AUTHENTICATION application.
- While adding the details, refer to this document for the config details and keep the following things in mind:
- Select the checkboxes, Enabled and Visible otherwise the social auth button won't be visible in the login or register pages.
- Add the icon css class in the Icon Class field. This will be used to display the icon in the social button.
- Add an appropriate name for the social app in the Name field. E.g. LinkedIn for LinkedIn app.
- Add the appropriate backend from the dropdown list, Backend name. E.g. google-oauth2 and linkedin-oauth2 for Google and LinkedIn respectively.
- Add the key and secret (acquired in the step 1) in the Client ID and Client Secret fields respectively.
- Add any other settings, like special scopes, you need to fetch in the Other Settings field. E.g. Add
{ "SCOPE": [“r_liteprofile", "r_emailaddress"], "FIELD_SELECTORS": ["emailAddress"] }
while adding this provider configuration for LinkedIn in order to fetch a user's Email Address upon authentication.
Note: A different redirect URI will have to be added for localhost, dev, staging and production servers as the urls are different. Replace the <example-url> with the target url before adding.
Enable language support:
- Go to the /admin and open dark lang configs table.
- Add a new dark lang config
- Make sure the new config is enabled and add en,ar in Released languages textbox and save. Now you will see a language switch at the home page. English and Arabic is supported for now.
Registration page and x_frame settings:
make lms-shell
vim /edx/etc/lms.yml
- Add/Update the following settings in the file and save the file.
ENABLE_COMBINED_LOGIN_REGISTRATION : true
REGISTRATION_EXTENSION_FORM : openedx.adg.lms.registration_extension.forms.ExtendedProfileForm
REGISTRATION_EXTRA_FIELDS:
city: required
confirm_email: hidden
country: hidden
gender: hidden
goals: hidden
honor_code: required
level_of_education: hidden
mailing_address: hidden
terms_of_service: hidden
year_of_birth: hidden
is_adg_employee: optional
company: hidden
X_FRAME_OPTIONS: 'SAMEORIGIN'
- Commit the container
Import Error: mandrill Issue (Configuring Mandrill on local machine)
If you face ImportError: No module named 'mandrill' on local machine this means that you need to install and configure mandrill. For this we added mandrill in requirement file edx-platform/requirements/adg/base.txt
. To install mandrill you need to follow following steps.
- Go to lms shell > In terminal from devstack directory
make lms-shell
- Change user to edxapp user >
sudo su edxapp
- Activate environment >
source /edx/app/edxapp/venvs/edxapp/bin/activate
- Install requirements >
paver install_prereqs
- Add MANDRILL_API_KEY in
/edx/etc/lms.yml
- vim /edx/etc/lms.yml
- At the end of file add 'MANDRILL_API_KEY: 'MANDRILL_API_KEY'
Import Error: MailChimp Issue (Configuring MailChimp on local machine)
Follow the first 4 steps as mentioned for Mandrill, next two steps are:
- Got to lms-shell and open LMS yml file and add the following keys at the end of file
You can open file with vim vim /edx/etc/lms.yml
and add following keys
- MAILCHIMP_API_KEY: 'MAILCHIMP_API_KEY'
- MAILCHIMP_LIST_ID: 'MAILCHIMP_LIST_ID'
Save docker changes by using command docker commit -m="Your Message" <CONTAINER_ID> edxops/edxapp:koa.master
- Got to studio-shell and repeat step 5 but for Studio yml file
vim /edx/etc/studio.yml
- Commit your docker image
Import Error: Zoomus Issue (Configuring Zoomus on local machine)
Follow the same steps as mentioned for MailChimp Issue. However, on steps 5 add following keys:
- ZOOM_USER_EMAIL: 'ZOOM_USER_EMAIL'
- ZOOM_API_KEY: 'ZOOM_API_KEY'
- ZOOM_SECRET_KEY: 'ZOOM_SECRET_KEY'
Enable instructors in studio
To enable instructors we need to add following feature flag in studio.yml
- make studio-shell
- vim /edx/etc/studio.yml
- Add feature flag
ENABLE_EXTENDED_COURSE_DETAILS
with valuetrue
underFEATURES
- Save and exit
- Commit docker to preserve changed settings
- Restart studio
Set course default mode
As per the business requirements of ADG all of the courses should be created in honor
mode, so instead of setting mode for every individual course in order to enable certificate we can follow these steps and set honor
as default course mode.
- make studio-shell
- vim /edx/etc/studio.yml
- Add this setting anywhere in the file
COURSE_MODE_DEFAULTS:
bulk_sku: None
currency: None
description: None
expiration_datetime: None
min_price: 0
name: 'Honor'
sku: None
slug: 'honor'
suggested_prices: ''
- Save and exit
- Commit docker to preserve changed settings
- Restart studio