feat: Implement python-decouple for environment variables management #187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces the use of
python-decouple
to manage the environment variables of the Django-CRM project. It also updates the installation and configuration documentation to reflect this change.Motivation:
Security: Storing sensitive information (such as API keys, database credentials) outside the source code, in a
.env
file, increases the security of the project.Flexibility: Makes it easier to configure the project in different environments (development, testing, production) without changing the code.
Organization: Centralizes the configurations in a
.env
file, making management simpler and more organized.Consistency: Ensures that environment variables are loaded consistently across all environments.
Change Details:
python-decouple
:python-decouple
torequirements.txt
..env
File:.env
file (contrib/env-sample
) to serve as a template..env
file have been added to the documentation.settings.py
:webcrm/settings.py
file has been updated to usepython-decouple
to read environment variables.config()
have been added to the documentation..gitignore
:.env
to.gitignore
to prevent sensitive information from being sent to the repository.python-decouple
".dj-database-url
has been added to make database configuration easier.Impact:
Testing:
Local testing has been performed to ensure that the project works correctly with the new settings.
Checklist:
python-decouple
installed and configured..env
file created and configured.settings.py
updated to usepython-decouple
..env
added to.gitignore
.dj-database-url
installed and configured.