feanil/development settings - #37444
Conversation
58c62d8 to
1afe2e2
Compare
1705ed8 to
d0db94c
Compare
d0db94c to
94dacd3
Compare
7ec8b88 to
473efe7
Compare
1fe0074 to
4d4d7c1
Compare
bf615ad to
1abf23b
Compare
1abf23b to
d16729a
Compare
0d156bf to
226fee5
Compare
Base it directly off of common and try to keep it as small as possible. Regarding plugin loading: Ideally the name of this setting would be "DEVELOPMENT" and not tied to the devstack but since that's an interface change, we use the devstack settings which should be what is setup for development. Regarding the webpack loader settings: WEBPACK_LOADER's STATS_FILE is derived from STATIC_ROOT in openedx/envs/common.py. In the new development.py settings the base STATIC_ROOT default is ENV_ROOT/staticfiles (LMS) and ENV_ROOT/staticfiles/studio (CMS), which point *outside* the repo. That is not where the webpack build writes its stats manifest: with STATIC_ROOT_LMS / STATIC_ROOT_CMS unset, webpack.common.config.js falls back to ./test_root/staticfiles (and .../studio for CMS). As a result render_bundle raised "Error reading .../staticfiles/webpack-stats.json" on every page that renders a webpack bundle. Point STATIC_ROOT at the in-repo test_root location so the derived STATS_FILE lands where webpack actually writes it. This makes the Python default agree with webpack's JS default with no STATIC_ROOT_LMS / STATIC_ROOT_CMS wiring, and mirrors what the test settings already do (openedx/envs/test.py). This is only about locating the stats manifest -- collectstatic is not part of the development flow. With DEBUG=True the staticfiles finders serve assets directly from their source dirs (e.g. the bundles in common/static/bundles), so nothing writes into STATIC_ROOT during normal development.
Document the new bare-metal development workflow that runs the LMS and CMS with the dedicated `development.py` settings module (building directly on `common.py`) and the `local.openedx.io` domains, rather than the legacy `devstack.py` settings on `localhost`. The how-to covers the `--settings=development` runserver commands (local.openedx.io:8000 for LMS, studio.local.openedx.io:8001 for CMS), migrations, the webpack asset build (and why collectstatic is not needed), CMS SSO setup, running the MFEs against the LMS MFE Config API, and the notable differences from devstack (eager Celery, MFE config served by the LMS, pre-declared CORS/CSRF/login-redirect origins). It is linked from the README as an experimental item under "For Development"; it is intentionally not yet the recommended default while the base README and workflow are still being updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The two settings were previously hard-coded in the lms and openedx common.py making it hard to make reasonable defaults using the ENV_ROOT setting.
Enable meilisearch by default and document what is needed on the server side to make it work cleanly.
226fee5 to
ec50752
Compare
kdmccormick
left a comment
There was a problem hiding this comment.
great work!
haven't tested yet, but here are my comments so far.
looking forward to merging this very soon.
| # that MFE turns out to need to call Studio APIs directly. | ||
| CORS_ORIGIN_WHITELIST = ( | ||
| "http://apps.local.openedx.io:2001", # authoring (Studio) | ||
| # "http://apps.local.openedx.io:1984", # communications |
There was a problem hiding this comment.
optional nit: consider just deleting all the commented-out lines to avoid drift. it's easy enough to copy these in from the LMS side if ever necessary.
| # Each development MFE is served under apps.local.openedx.io on its own port. Every MFE fetches its | ||
| # config from the LMS MFE Config API, so each origin must be allowed here for that cross-origin | ||
| # request to succeed. | ||
| CORS_ORIGIN_WHITELIST = ( |
There was a problem hiding this comment.
| CORS_ORIGIN_WHITELIST = ( | |
| CORS_ORIGIN_WHITELIST = ( | |
| # frontend-base shell (all new-style apps): | |
| "http://apps.local.openedx.io:8080", | |
| # old-style "MFE" apps: |
I suggest adding frontend-base here, as well as to LOGIN_REDIRECT_WHITELIST, CSRF_TRUSTED_ORIGINS, and the CMS versions of those lists.
| # the MFE origin must be trusted here or Studio rejects writes with a 403 ("Origin checking | ||
| # failed"). Scoped to the authoring MFE for the same reason as CORS_ORIGIN_WHITELIST above; | ||
| # uncomment another origin if that MFE needs to make write requests to Studio. | ||
| CSRF_TRUSTED_ORIGINS = [ |
There was a problem hiding this comment.
curious, do you know why CSRF_TRUSTED_ORIGINS is needed for CMS but not LMS?
kdmccormick
left a comment
There was a problem hiding this comment.
just going to approve and merge, since it's easier to generate feedback by just testing this out with features I'm working on. will follow up with a PR with my suggested improvements later on :)
The ENABLE_MFE_CONFIG_API toggle was removed from the platform by the DEPR in openedx#39019, which merged on 2026-08-26. The new development.py settings merged afterwards in openedx#37444 on 2026-09-18, so this override was already dead when it landed. Nothing reads the setting now. MFEConfigView in lms/djangoapps/mfe_config_api/views.py serves /api/mfe_config/v1 with no toggle check, so assigning the name here has no effect. The comment above it is also wrong on its own terms: it says the API is off by default in common.py, and common.py no longer defines the flag at all. The comment asked for this cleanup once the DEPR landed, so this is that follow-up. DEPR: openedx#38959 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds experimental
development.pysettings for the LMS and CMS that build directly oncommon.py, as a first step toward replacing thedevstack.py/production.py-based local development flow with something cleaner and better documented. Useslocal.openedx.iosubdomains instead oflocalhostso cookie / CORS / CSRF behavior resembles a real deployment.Experimental — not the default.
devstack.pyandproduction.pyare unchanged, so existing developers and operators are unaffected. Setup steps:docs/how-tos/using_development_settings.rst.Related PRs (need to merge)
Companion PRs pointing each default MFE's
devscript atlocal.openedx.ioso they work with these settings: