def app(config_path: str) -> Flask: os.environ["CONFIG_PATH"] = config_path # Disable password hashing in tests to get speed-up settings_to_override = { "SECURITY_PASSWORD_HASH": "plaintext", "SECURITY_HASHING_SCHEMES": ["hex_md5"], "SECURITY_DEPRECATED_HASHING_SCHEMES": [], } return create_app(settings_to_override)
from web_app.app import create_app if __name__ == "__main__": my_app = create_app() my_app.run(debug=True)
def app(config_path: str) -> Flask: os.environ["CONFIG_PATH"] = config_path return create_app()
def app(): app = create_app(config_object=TestingConfig) with app.app_context(): yield app
import os import sys # Path restructure for imports script_dir = os.path.dirname(__file__) main_dir = os.path.join(script_dir, '..') sys.path.append(main_dir) from web_app.app import create_app APP = create_app() # Initializing APP # Helpful code for development # set FLASK_ENV=development # set FLASK_APP=web_app:APP # import pdb; pdb.set_trace() # pipenv --rm
import os from web_app.app import create_app from web_app.config import DevelopmentConfig, ProductionConfig, get_logger _logger = get_logger(logger_name=__name__) config_object = eval(os.environ['APP_SETTINGS'].split('.')[1]) application = create_app(config_object=config_object) if __name__ == '__main__': application.run()