Environment configuration

Properly configuring a development, test or production environment is important for the successful execution of your Python application.

There are many de facto names for environments:

  1. Local development
  2. Development / integration
  3. Test
  4. Staging
  5. Production

The above list provides the common environment names but there can be a limitless number and each organization has their own configuration.

Environment variables

Environment variables are modifiable system values that can be read by Python applications to affect a program's execution.

One answer I found very useful when learning about getting environment variables in Python code is knowing the difference between os.getenv and os.environ.get. Either one can be used in your applications but there are slight differences that can make one better than the other in various situations.

Other useful environment variables resources: * The Twelve-Factor App describes a method for securing environment data for your applications. The twelve factors are commonly referenced across many programming ecosystems, not just Python, so it's worthwhile to familiarize yourself with how to use this method to configure your applications.

Environment configuration resources

你想要编码什么?

我想学习如何用框架创建 Python Web 应用。

我已经创建了一个 Python Web 应用,那我该如何部署呢?

带我回到全栈 Python 的介绍。

Sign up for a monthly email with Full Stack Python tutorials. No spam ever.