From e18409aabea428b1f2cb8e92a63456d506e4ff1d Mon Sep 17 00:00:00 2001 From: NoyanAziz Date: Wed, 2 Oct 2024 16:45:07 +0500 Subject: [PATCH] feat: add local setup for CT in README.rst --- README.rst | 31 ++++++++++++++++++++++++++ commerce_coordinator/settings/local.py | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 014b9d46..f249bef2 100644 --- a/README.rst +++ b/README.rst @@ -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 ============================================= @@ -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 diff --git a/commerce_coordinator/settings/local.py b/commerce_coordinator/settings/local.py index 889b5c1d..17bd5c97 100644 --- a/commerce_coordinator/settings/local.py +++ b/commerce_coordinator/settings/local.py @@ -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.