from flask import Flask from owsrequest import flask_request from content import config def create_app(): app = Flask("ows-content") flask_request.setup( app, config.ENVIRONMENT, add_request_context=True, label_profile=True, verify_access=True, rules_file="content/access_rules.yml", # ONLY_LOG_ACCESS_ERRORS is read from environment — True in staging, False in prod. # When True, access rule violations are logged but requests are NOT rejected. access_log_only=config.ONLY_LOG_ACCESS_ERRORS, exclude_paths=["/hello/", "/public/meta-type"], ) return app