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

Adding a way to get env vars from Settings class #60

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

marcieltorres
Copy link
Owner

What changes do you are proposing?

Improving the Settings class to handle environment variables.

Before

from config.settings import settings
from os import getenv

app_name = settings.get('app_name')
env_var_value = getenv('env_var_name')

After

from config.settings import settings

app_name = settings.get('app_name')
env_var_value = settings.get_from_env('env_var_name')
  1. When the settings package is already imported, the os import becomes unnecessary;;
  2. The Settings class is now the primary interface for accessing both environment and static settings values;

How did you test these changes?

I created unit tests to verify the new behavior.

@marcieltorres marcieltorres self-assigned this Oct 17, 2024
@marcieltorres marcieltorres merged commit 88e034b into main Oct 17, 2024
1 check passed
@marcieltorres marcieltorres deleted the feat/adding-get-from-env-var-on-settings branch October 17, 2024 12:17
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

Successfully merging this pull request may close these issues.

1 participant