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

Implement configuration reference generation #283

Open
ftsell opened this issue Apr 20, 2021 · 0 comments
Open

Implement configuration reference generation #283

ftsell opened this issue Apr 20, 2021 · 0 comments

Comments

@ftsell
Copy link
Member

ftsell commented Apr 20, 2021

In my opinion there should be a way to automatically generate a configuration reference for my Django project when using django-configurations so that I can easily include it in project documentation without just referencing some source file.


I was thinking of a workflow like the following:

from configurations import Configuration, values

class MyConfiguration(Configuration):
    DEBUG = values.BooleanValue(default=True)
    SECRET_KEY = values.SecretValue(description="The django secret key", reference="https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-SECRET_KEY")
    IS_AWESOME_FEATURE_ENABLED = values.BooleanValue(description="Enables the awesome feature because of which you want to run this application")
manage.py create-configuration-reference --format github-markdown-table --out ./configuration-reference.md
Key | Type | Default | Description
--- | --- | --- | ---
DEBUG | [bool](https://django-configurations.readthedocs.io/en/stable/values/#configurations.values.BooleanValue) | True |
SECRET_KEY | [secret](https://django-configurations.readthedocs.io/en/stable/values/#configurations.values.SecretValue) | *not set* | [reference](https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-SECRET_KEY): The django secret key
IS_AWESOME_FEATURE_ENABLED | [bool](https://django-configurations.readthedocs.io/en/stable/values/#configurations.values.BooleanValue) | *not set* | Enables the awesome feature because of which you want to run this application

Which renders as

Key Type Default Description
DEBUG bool True
SECRET_KEY secret not set reference: The django secret key
IS_AWESOME_FEATURE_ENABLED bool not set Enables the awesome feature because of which you want to run this application

I am willing to implement and maintain this feature if it is desired.
I am also open for discussions about the details.

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

1 participant