Sometimes, we will need to save values such as passwords, API keys, etc. to be consumed by custom operations or commands.
Here is how to save secure values or passwords.
You must access from the advanced administration area and go to the menu:
- Home » Config » Config secret properties
Once there, create a new property.
Edit the name, description, and enter in "Value", the password. This value will not be visible to users.
Once set, this property can be used from a custom operation as follows:
from config.utils import get_config
secret_value = get_config('[NAME]', secret=True)
In secret_value will be the value to be used.
Comments
0 comments
Please sign in to leave a comment.