Best practice to manage different env dev, integration, production, uat?

Hi, I have a Python code that needs to be configured according to the env :

  • development
  • integration
  • production

To solve this, I have written all settings in a Python file and I have added 3 other Python files for each environment:

  • :arrow_right: for development
  • :arrow_right: for integration
  • :arrow_right: for production

I am not very satisfied with this. What is the officially recommend way achieve this in Python ?

And what are the best practices to manage this ? I wonder if using a .config or a .yml file wouldn’t be more adapted.

I am also wondering how to configure the logging, as I have currently set it up inside a .py file.
How do you manage development/integration/production specific variables ? do you have examples and url link of best practices to manage this ? Regards