To install and start the edX E-Commerce service, you must complete the following steps.
These steps assume that you are running Open edX devstack. If you prefer to run the E-Commerce service locally on your computer instead of on the virtual machine (VM) that devstack uses, see Development Outside Devstack.
Create or activate a Python virtual environment. You execute all of the commands described in this section within the virtualenv (unless otherwise noted).
For more information, see Virtual Environments.
Run the following command to install dependencies.
$ make requirements
(Optional) Create settings overrides that you do not commit to the
repository. To do this, create a file named
reads the values in this file, but Git ignores the file.
The E-Commerce service relies on the edX OpenID Connect (OIDC) authentication provider for login. OIDC is built on top of OAuth 2.0. Currently, the LMS serves as the authentication provider.
To configure the E-Commerce service to work with OIDC, complete the following procedures.
To create and register a new OIDC client, follow these steps.
Start the LMS.
In your browser, go to
Select Add client.
Leave the User field blank.
For Client Name, enter
For URL, enter
For Redirect URL, enter
This is the OIDC client endpoint.
The system automatically generates values in the Client ID and Client Secret fields. You use these values when you update Django settings.
For Client Type, select Confidential (Web applications).
After you create your client, designate it as trusted. Trusted clients bypass the user consent form that usually appears after the system validates the user’s credentials.
To designate your client as trusted, follow these steps.
To finish creating and configuring your OIDC client, add the client credentials to the Django settings for your project.
ecommerce/settings/local.py file, update the following settings.
||OAuth 2.0 client key||Enter the value from the Client ID field in the Create and Register a Client section.|
||OAuth 2.0 client secret||Enter the value from the Client Secret field in the Create and Register a Client section.|
||OAuth 2.0 authentication URL||Enter
||OIDC ID token decryption key, used to validate the ID token||Set this to the same value as
To complete the installation and start the E-Commerce service, follow these steps.
Local installations use SQLite by default. If you use another database backend, make sure you update your settings and create the database, if necessary, before you run migrations.
(Devstack only) If you are using devstack, switch to the
and use the
ecommerce.settings.devstack settings module to run the
$ sudo su ecommerce $ make devserve
To run migrations, execute the following command.
$ make migrate
To run the server, execute the following command.
$ python manage.py runserver 8002
If you use a different port, make sure you update the OIDC client by using the Django administration panel in the LMS. For more information about configuring the OIDC client, see Configure edX OpenID Connect (OIDC).
If you are running the LMS in devstack but would prefer to run the
E-Commerce service on your host, set up a reverse port-forward. This reverse
port-forward allows the LMS process inside your devstack to use
127.0.0.1:8002 to make calls to the E-Commerce service running on your
host. This simplifies LMS URL configuration.
To set up a reverse port-forward, execute the following command when you SSH into your devstack. Make sure that you run this command on the VM host, not the guest.
$ vagrant ssh -- -R 8002:127.0.0.1:8002