magpie.api.home¶
Submodules¶
Package Contents¶
-
magpie.api.home.get_homepage(request)[source]¶ Magpie API homepage (only if Magpie UI is not enabled).
-
magpie.api.home.get_constant(constant_name, settings_container=None, settings_name=None, default_value=None, raise_missing=True, print_missing=False, raise_not_set=True) → SettingValue[source]¶ - Search in order for matched value of
constant_name: - search in settings if specified
- search alternative setting names
- search in
magpie.constantsdefinitions - search in environment variables
Parameter
constant_nameis expected to have the formatMAGPIE_[VARIABLE_NAME]although any value can be passed to retrieve generic settings from all above mentioned search locations.If
settings_nameis provided as alternative name, it is used as is to search for results ifconstant_namewas not found. Otherwise,magpie.[variable_name]is used for additional search when the formatMAGPIE_[VARIABLE_NAME]was used forconstant_name(ie:MAGPIE_ADMIN_USERwill also search formagpie.admin_userand so on for corresponding constants).Parameters: - constant_name – key to search for a value
- settings_container – wsgi app settings container
- settings_name – alternative name for settings if specified
- default_value – default value to be returned if not found anywhere, and exception raises are disabled.
- raise_missing – raise exception if key is not found anywhere
- print_missing – print message if key is not found anywhere, return None
- raise_not_set – raise an exception if the found key is None, search until last case if previous are None
Returns: found value or default_value
Raises: according message based on options (by default raise missing/None value)
- Search in order for matched value of