17 captures
29 Sep 2017 - 29 Nov 2025
Sep OCT Nov
31
2020 2021 2022
success
fail

About this capture

COLLECTED BY

Collection: Save Page Now Outlinks

TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20211031052100/https://www.fullstackpython.com/environment-configuration.html
 

Full Stack Python logoFull Stack Python
All topics | Blog | Supporter's Edition | @fullstackpython | Facebook | What's new?

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:


(一)Local development

(二)Development / integration

(三)Test

(四)Staging

(五)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: * How to Set Environment Variables in Linux and Mac: The Missing Manual is a wonderfully detailed guide with many tips and tricks throughout the walkthrough such as quickly setting environment variables for a single command, passing environment variables through when using sudo and executing a command in a "clean" environment without everything you have already set interfering or being accessible to that script.



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.



Everything You Need to Know About the Twelve-Factor App breaks down the original twelve-factor app source material and provides solid additional advice and context.



Environment variables on Ubuntu Linux



Why you shouldn't use ENV variables for secret data



Environment variables in Windows



Security of infrastructure secrets elaborates on techniques to protect your secret tokens such as API keys as well as the threats that are out there which put your secrets at risk.


Environment configuration resources




Staging Servers, Source Control & Deploy Workflows, And Other Stuff Nobody Teaches You



Deployments best practices explains the differences between various environments and why you need each one.



Best practices for staging environments



Staging environment vs Production environment



A good QA team needs a proper software staging environment for testing


What do you want to code?





I want to learn how to code a Python web application using a framework.
 




I've built a Python web app, now how do I deploy it?
 




Take me back to the Full Stack Python introduction.
 





Sponsored By


AssemblyAI logo
The most accurate speech-to-text API. Built for Python developers.





Table of Contents



1. Introduction 2. Development Environments Text Editors & IDEs Vim Emacs Sublime Text PyCharm Jupyter Notebook Shells Bash shell Zsh PowerShell Terminal Multiplexers tmux Screen Environment configuration Application Dependencies Virtualenvs Localhost tunnels Source Control Git Mercurial 3. Data 4. Web Development 5. Deployment 6. DevOps Changelog What Full Stack Means About the Author Future Directions Page Statuses ...or view the full table of contents.



Full Stack Python


Full Stack Python is an open book that explains concepts in plain language and provides helpful resources for those topics.

Updates via Twitter & Facebook.



Chapters



1. Introduction 2. Development Environments » Environment configuration 3. Data 4. Web Development 5. Deployment 6. DevOps Changelog What Full Stack Means About the Author Future Directions Page Statuses ...or view the full table of contents.

 



Matt Makai 2012-2021