Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
from web_app.app import create_app

if __name__ == "__main__":
    my_app = create_app()
    my_app.run(debug=True)
Ejemplo n.º 3
0
def app(config_path: str) -> Flask:
    os.environ["CONFIG_PATH"] = config_path
    return create_app()
Ejemplo n.º 4
0
def app():
    app = create_app(config_object=TestingConfig)
    with app.app_context():
        yield app
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
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()