Instructions for how to bring up the ecommerce service in devstack.
In order to run the ecommerce service in devstack:
SSH into a running devstack with the ecommerce service installed:
$ vagrant ssh |
Switch to the ecommerce
user:
$ sudo su ecommerce |
Activate the ecommerce virtual environment:
$ source ../venvs/ecommerce/bin/activate |
Build the dependencies:
$ make requirements |
Start the ecommerce server:
$ python manage.py runserver 0.0.0.0:8002 --settings=ecommerce.settings.devstack |
In a separate tab/window, SSH into the same devstack, and switch to the edxapp
user:
$ sudo su edxapp |
Verify that the following settings in /edx/app/edxapp/lms.env.json
(the file is up one directory level to the edx-platform directory that the su command switched you to) are correct The ecommerce file that you are checking the values against is /edx/etc/ecommerce.yml. The variable name for JWT_ISSUER may be JWT_ISSUER (a single value) or JWT_ISSUERS (an array of values) depending on the application version:
"ECOMMERCE_API_URL": "http://localhost:8002/api/v2/" "ECOMMERCE_PUBLIC_URL_ROOT": "http://localhost:8002/" "JWT_ISSUER": "http://127.0.0.1:8000/oauth2" // Must match the JWT_ISSUER setting on ecommerce "OAUTH_ENFORCE_SECURE": false "OAUTH_OIDC_ISSUER": "http://127.0.0.1:8000/oauth2" |
Verify that the following settings in /edx/app/edxapp/lms.auth.json are correct - comparing against the ecommerce.yml file from the previous step:
"EDX_API_KEY": "replace-me" // Must match EDX_API_KEY setting on ecommerce "ECOMMERCE_API_SIGNING_KEY": "insecure-secret-key" // Must match the JWT_SECRET_KEY setting on ecommerce |
Start the LMS server:
$ paver devstack lms |
ssh into your vagrant instance and switch to the edxapp user, once user is switched, kick off the interactive shell:
$ vagrant ssh $ sudo su edxapp $ ./manage.py lms --settings aws shell |
Once in the Shell, execute the following code, replacing your-user with your new user account, created above:
from django.contrib.auth.models import User me = User.objects.get(username="your-user") me.is_superuser = True me.is_staff = True me.is_active = True # Alternatively, you could follow the activation link in the console output (what would have been sent by email if this wasn't a dev instance) me.save() exit() |
Copy down the 'Client-id' and 'Client-secret' values:
Jump back to your vagrant ssh shell. Exit out of the edxapp user (run whoami if you aren't sure) and switch to the ecommerce user account. Source the activate environment variables into your running shell.
$ whoami edxapp $ exit $ sudo su ecommerce $ source ../venvs/ecommerce/bin/activate |
Using the client-id and client-secret values from above, run the 'create_or_update_site' command in the python command-line interface. The partner code is arbitrary and can be any value you like, for payment processors, use paypal, and for the email address, use one that you don't mind getting dev emails delivered to:
$ ./manage.py create_or_update_site --site-domain localhost:8002 --lms-url-root http://localhost:8000 --partner-code edx --payment-processors paypal --client-id ecommerce-key --client-secret ecommerce-secret --from-email your-email@edx.org |
Restart the ecommerce server:
$ python manage.py runserver 0.0.0.0:8002 --settings=ecommerce.settings.devstack |
Both services are now up and running. If you've configured any products, they should now be fulfilled by the ecommerce service.
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|