Adding Environment Variables

Due to the abundance of information in regards to configuring environment variables, it can be challenging to find information that will result in success.

Here we will try and and point you in the correct direction.

What is an environment variable?

For our requirements, we will think of an environment variable, as a variable stored outside the scope of the application.

Python programs can access these variables via the os module

Why store the token in an environment variable?

There are a couple of reason. Primarily:

  • Convenience, create a client with OandaClient() not OandaClient(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
  • Secure, prevents you from uploading the token to an online repository
  • May simplify deployment of your trading program