Python offers a variety of ways that we can package application inputs and configuration files. We'll look at writing files in Python notation because it's elegant and simple.
A number of packages use assignment statements in a separate module for providing configuration parameters. The Flask project in particular, can do this. We looked at Flask in the Using the Flask framework for RESTful APIs recipe and a number of related recipes in Chapter 10, Web Services.
How can we represent configuration details in Python module notation?
Python assignment statement notation is particularly elegant. It's quite simple, easy to read, and extremely flexible. If we use assignment statements, we can import the configuration details from a separate module. This could have a name like settings.py
to shows that it's focused on configuration parameters.
Because Python treats each imported module as a global Singleton object, we can have several parts of an application...