Skip to content

Create initial configuration handling and options #66

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

Open
joshuadavidthomas opened this issue Jan 3, 2025 · 3 comments
Open

Create initial configuration handling and options #66

joshuadavidthomas opened this issue Jan 3, 2025 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@joshuadavidthomas
Copy link
Owner

Need to get config working for basic settings like Django settings module and venv path. Should be flexible, highest priority to lowest:

  • CLI flags
  • Config files (pyproject.toml or djls.toml)
  • Environment vars as fallback

To start:

  • The project's settings module
  • Maybe the venv path?

What other settings do we need besides these basics?

@joshuadavidthomas joshuadavidthomas added the enhancement New feature or request label Jan 3, 2025
@joshuadavidthomas joshuadavidthomas changed the title Create initial configuration handling and initial options Create initial configuration handling and options Jan 3, 2025
@joshuadavidthomas
Copy link
Owner Author

I think to start we should just handle config files. Tagspecs should be included, and I'm not totally sure how to handle some configuration options in config files but not env vars (seems a bit silly to allow tagspec definitions in env vars?).

Anyway, initial configuration should be:

  • debug
  • settings module
  • venv path
  • tagspecs

For now, we can keep the CLI args separate, since there doesn't seem to be a way to combine Clap config args and the config crate's config parsing. I would use a different crate, but that seems to be the most popular and I'd rather go with it for the time being.

@joshuadavidthomas
Copy link
Owner Author

The core file-based configuration loading logic (user djls.toml, project pyproject.toml, .djls.toml, djls.toml) is implemented in the djls-conf crate. This handles the debug and venv_path settings mentioned or implied here.

For now, CLI argument integration and environment variable fallbacks are being deferred due to complexity with integrating clap and handling structured settings like tagspecs via env vars.

The remaining specific configuration options originally discussed (settings_module, tagspecs) are now tracked in dedicated issues #114 and #115 respectively. This issue can be considered mostly complete regarding the foundational file-loading system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

1 participant