Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Greenfield prod-ready Django settings without YAML #35146

Open
Tracked by #35144
kdmccormick opened this issue Jul 19, 2024 · 4 comments
Open
Tracked by #35144

Greenfield prod-ready Django settings without YAML #35146

kdmccormick opened this issue Jul 19, 2024 · 4 comments

Comments

@kdmccormick
Copy link
Member

kdmccormick commented Jul 19, 2024

Background

Proposal

"Just" start fresh with idiomatic Python-defined Django settings files.

There would be four new settings files:

  • lms/settings.py
  • lms/test_settings.py (derived from lms/settings.py)
  • cms/settings.py (derived from lms/settings.py)
  • cms/test_settings.py (derived from cms/settings.py and lms/test_settings.py)

The recommended mechanism for configuring edx-platform would be to define a Django settings module for LMS and for CMS, each based on their respective settings.py module, and then set DJANGO_SETTINGS_MODULE to point to the correct custom module in each environment. This is standard Django practice.

Several things would be deprecated:

  • all of lms/envs/
  • all of cms/envs/
  • yaml-based config via LMS_CFG and CMS_CFG

Backwards compatibility

Tutor would need to change significantly to adapt to this, but it could certainly be done, and possibly could be done in a way that doesn't break any patch points from the perspective of Tutor plugin devs and users.

Direct deployers of edx-platform would need to adapt. We would leave lms/envs/ and cms/envs/ in place for 6 months to allow for migration. After they are removed, direct deployers could still use them (and YAML config) by copying the settings modules they need into their private fork and/or deployment pipeline, and setting DJANGO_SETTINGS_MODULE accordingly.

@kdmccormick kdmccormick changed the title Flat prod-ready default settings without YAML [Idea] Flat prod-ready default settings without YAML Jul 19, 2024
@kdmccormick kdmccormick changed the title [Idea] Flat prod-ready default settings without YAML [Spike] Flat prod-ready default settings without YAML Jul 19, 2024
@kdmccormick kdmccormick changed the title [Spike] Flat prod-ready default settings without YAML Greenfield prod-ready Django settings without YAML Jul 19, 2024
@kdmccormick
Copy link
Member Author

fyi @feanil

@feanil
Copy link
Contributor

feanil commented Jul 22, 2024

I realized that we may also want a standard dev_settings.py

@kdmccormick
Copy link
Member Author

kdmccormick commented Jul 22, 2024

@feanil good pooint. I was imagining that Tutor would take care of overriding settings.py for development, but on second thought, if we want to support bare-metal dev, then we need dev_settings.py as well.

One question that raises is whether dev_settings.py would use localhost:xxxx as the LMS_BASE vs. a container-friendly domain like local.openedx.io. If the latter, then Tutor could use dev_settings.py as a base.

@feanil
Copy link
Contributor

feanil commented Jul 23, 2024

Yea, I'm totally okay with it using a container friendly domain by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants