hawat.app module

This module contains core application features for Hawat, the official user web interface for the Mentat system.

The most important fetures of this module are the hawat.app.create_app() and hawat.app.create_app_full() factory methods, that are responsible for bootstrapping the whole application (see their documentation for more details).

hawat.app.APP_NAME = 'hawat'

Name of the application as a constant for Flask.

hawat.app.create_app()[source]

Factory function for building Hawat application. This function does not take any arguments, any necessary customizations must be done using environment variables.

Returns

Hawat application

Return type

hawat.base.HawatApp

hawat.app.create_app_full(config_dict=None, config_object='hawat.config.ProductionConfig', config_file=None, config_env='HAWAT_CONFIG_FILE', config_func=None)[source]

Factory function for building Hawat application. This function takes number of optional arguments, that can be used to create a very customized instance of Hawat application. This can be very usefull when extending applications` capabilities or for purposes of testing. Each of these arguments has default value for the most common application setup, so for disabling it entirely it is necessary to provide None as a value.

Parameters
  • config_dict (dict) – Initial default configurations

  • config_object (str) – Name of the class or module containing configurations

  • config_file (str) – Name of the file containing additional configurations

  • config_env (str) – Name of the environment variable pointing to file containing configurations

  • config_func (callable) – Callable that will receive app.config as parameter

Returns

Hawat application

Return type

hawat.base.HawatApp