Environment variables
When we create a program, we often want the user to be able to configure some of its behavior. For example, say you have a program that connects to a database and saves all the records it finds into a file. Normally, it would probably print out just a success message to the terminal, but you might also want to run it in debug mode, which also makes it print out all the SQL statements it is executing.
There are many ways of configuring a program like this. For example, you could have it read from a configuration file. But in some cases, the user may quickly want to run the Django server with a particular setting on (say, debug mode), and then run the server again with the same setting off. Having to change the configuration file every time can be inconvenient. In this case, we can read from an environment variable. Environment variables are key-value pairs that can be set in your operating system and then read by a program. There are several ways they can be...