Updating app config red flag warning in dating

19-Nov-2018 19:35

There are different settings you might want to change depending on the application environment like toggling the debug mode, setting the secret key, and other such environment-specific things.

The way Flask is designed usually requires the configuration to be available when the application starts up.

You can hardcode the configuration in the code, which for many small applications is not actually that bad, but there are better ways.

Independent of how you load your config, there is a config object available which holds the loaded configuration values: The object.

This is the place where Flask itself puts certain configuration values and also where extensions can put their configuration values.

But this is also where you can have your own configuration. Exceptions are propagated rather than handled by the the app’s error handlers.

This is useful for caching because it ensures the data is serialized the same way no matter what Python’s hash seed is.While not recommended, you can disable this for a possible performance improvement at the cost of caching.Default: Configuration becomes more useful if you can store it in a separate file, ideally located outside the actual application package.This makes packaging and distributing your application possible via various package handling tools ( The configuration files themselves are actual Python files.

Only values in uppercase are actually stored in the config object later on.

So make sure to use uppercase letters for your config keys.