In this post I will show one way of referencing credentials from your application in Python, without setting them in your applications code. We will create a seperate python file which will hold our credentials, and then call them from our main application.
Our Main Application
This app will print our username, just for the sake of this example:
1 2 3 4 5 6 |
|
Our Credentials File
Then we have our file which will hold our credentials:
1 2 3 4 5 6 |
|
That is at least one way of doing it, you could also use environment variables using the os
module, which is described here