configuration

Django default settings convention for pluggable app?

Django default settings convention for pluggable app? Question: What’s a djangonautic way of handling default settings in an app if one isn’t defined in settings.py? I’ve currently placed a default_settings file in the app and I’ve considered a few options. I’m leaning towards the first option, but there may be pitfalls I’m not aware of …

Total answers: 6

ConfigParser vs. import config

ConfigParser vs. import config Question: ConfigParser is the much debated vanilla configuration parser for Python. However you can simply import config where config.py has python code which sets configuration parameters. What are the proscons of these two approaches of configuration? When should I choose each? Asked By: Jonathan Livni || Source Answers: “import config” is …

Total answers: 4

Python pattern for sharing configuration throughout application

Python pattern for sharing configuration throughout application Question: I have an application consisting of a base app that brings in several modules. The base app reads a parameter file into a configuration hash, and I want to share it across all my modules. Currently, I am passing a ‘parent’ object down to modules, and then …

Total answers: 4

Multiple configuration files with Python ConfigParser

Multiple configuration files with Python ConfigParser Question: When calling ConfigParser.read you are allowed to pass a list of strings corresponding to potential locations for configuration files and the function returns a list of those files that were successfully read. What is the default behaviour when multiple configuration files are loaded that have overlapping sections/keys? Do …

Total answers: 2