So we’ve all seen that secrets page in the tools section but what does it actually do? Well the massive clue is in the name, It keeps data like passwords and/ or anything else you want secret. This tutorial will show you have to set a variable to the data you put in your secret.
First up your going to need to go into the tools menu and click on the secrets icon and then what you need to do is to click the New Secret button in the top left and once you’ve done that it should say Key: Secret_Key Value:… and what you need to do for Key is name your secret for later, I called mine Example and then name the Value to your Password/ Hidden data and then what you need to do is go to your main.py file and import os with the code import os and then copy and paste this code in: your_variable_here = os.environ['Example'] and once you’ve done that you need to switch out my Example key with your key and then you need to change the variable to anything you can remember/ want to use. Thanks for reading and I hope this is useful to you!