Skip to content

Commit

Permalink
feat: add local setup for CT in README.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
NoyanAziz authored Oct 2, 2024
1 parent dadccbd commit e18409a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@ Local
# You should see JSON output indicating that two receivers were called, one successful, and one with exception/traceback information.
# In the shell where the server is running you should see log output indicating that two test receivers were called with the sender argument "Something".
Local setup with Commercetools
===============================

1. Update the following inside **`commerce_coordinator/settings/base.py`** file:
1. `COMMERCETOOLS_CONFIG`,
The values can be found at:
https://twou.frontastic.io/configuraaton?environment=development&project=checkout&locale=en_US

2. `COMMERCETOOLS_FRONTEND_URL` = `'http://localhost:3000/en/add-to-cart/'`

2. Update the following **waffle flags**:
1. Go to http://localhost:8140/admin/waffle/flag/ and add these flags

- `transition_to_commercetools.redirect_to_commercetools_checkout` flag with the **Everyone** attribute set to **Yes**.
2. Go to http://localhost:18000/admin/waffle/flag/ and add these flags

- `commerce.transition_to_coordinator.checkout` flag with the **Everyone** attribute set to **Yes**
- `commerce.transition_to_coordinator.refunds` flag with the **Everyone** attribute set to **Yes**

3. Update the following inside your `'edx-platform/lms/envs/private.py'` file:

- COMMERCE_COORDINATOR_REFUND_SOURCE_SYSTEMS = ('commercetools',)
- COMMERCE_COORDINATOR_URL_ROOT = 'http://localhost:8140'

4. For refunds flow, update this value and revert back after running refunds flow

- COMMERCE_COORDINATOR_URL_ROOT = 'http://host.docker.internal:8140'


Every time you develop something in this repo
=============================================
Expand Down Expand Up @@ -118,6 +146,9 @@ Local testing with Celery
# Start redis in devstack from your local devstack directory
make dev.up.redis
# Update the CELERY_BROKER_URL flag
Update CELERY_BROKER_URL to "redis://:password@localhost:6379/0" inside `commerce_coordinator/settings/local.py`
# Start celery from the commerce-coordinator venv; this management command will auto-reload celery when python files are changed
python manage.py celery
Expand Down
2 changes: 1 addition & 1 deletion commerce_coordinator/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

LOGGING = get_logger_config(debug=DEBUG)

CELERY_BROKER_URL = "redis://:@localhost:6379/0"
CELERY_BROKER_URL = "redis://:password@localhost:6379/0"

EDX_API_KEY = 'PUT_YOUR_API_KEY_HERE' # This is the actual API key in devstack.

Expand Down

0 comments on commit e18409a

Please sign in to comment.