.env.python.local
For polyglot projects or microservices, you can extend this pattern:
In your Python code, you would load the shared file first, then your specific local overrides.
# .env.python.local
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=dev-key
# app.py from dotenv import load_dotenv load_dotenv('.env.python.local')
from flask import Flask app = Flask(name) app.config['SECRET_KEY'] = os.getenv('SECRET_KEY').env.python.local
# config.py from pydantic import BaseSettingsclass Settings(BaseSettings): database_url: str secret_key: str debug: bool = False For polyglot projects or microservices, you can extend
class Config: env_file = ".env.python.local" env_file_encoding = "utf-8"
settings = Settings()
Create a .env file in the root of your project to store environment variables that are shared across different environments.