{"site":"project_search","repo":"flask","task":"El entorno de pruebas no está simulando correctamente los objetos globales de la petición al usar el gestor de contexto, lo que impide que se accedan a la sesión o a la configuración actual durante los tests unitarios.","query":"test request context","file":"src/flask/app.py","symbol":"test_request_context","line":1520,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 915: - ``Flask.test_request_context`` accepts ``subdomain`` and","file":"CHANGES.rst","line":915,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1603: - Test client has not the ability to preserve the request context for","file":"CHANGES.rst","line":1603,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/appcontext.rst\nLine 99: :meth:`.Flask.test_request_context` in a ``with`` block.","file":"docs/appcontext.rst","line":99,"lexical":0.65,"target":false},{"text":"File: docs/appcontext.rst\nLine 107: with app.test_request_context(","file":"docs/appcontext.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/quickstart.rst\nLine 258: For example, here we use the :meth:`~flask.Flask.test_request_context` method","file":"docs/quickstart.rst","line":258,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 259: to try out :func:`~flask.url_for`. :meth:`~flask.Flask.test_request_context`","file":"docs/quickstart.rst","line":259,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 279: with app.test_request_context():","file":"docs/quickstart.rst","line":279,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 22: using the :attr:`~flask.Flask.test_request_context` method which creates","file":"docs/shell.rst","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 25: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 50: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 294: Use ``with app.test_request_context()`` to push a request context. It","file":"docs/testing.rst","line":294,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 300: with app.test_request_context(","file":"docs/testing.rst","line":300,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 308: Creating a test request context doesn't run any of the Flask dispatching","file":"docs/testing.rst","line":308,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 316: with app.test_request_context(\"/user/2/edit\", headers={\"X-Auth-Token\": \"1\"}):","file":"docs/testing.rst","line":316,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1511: environ is not trivial. Use :meth:`test_request_context` to correctly","file":"src/flask/app.py","line":1511,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 1520: def test_request_context(self, *args: t.Any, **kwargs: t.Any) -> AppContext:","file":"src/flask/app.py","line":1520,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1531: with app.test_request_context(...):","file":"src/flask/app.py","line":1531,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 210: \"\"\"Test if an app context is active and if it has request information.","file":"src/flask/ctx.py","line":210,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 236: \"\"\"Test if an app context is active. Unlike :func:`has_request_context`","file":"src/flask/ctx.py","line":236,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 268: app context if needed during setup, and :meth:`.Flask.test_request_context`","file":"src/flask/ctx.py","line":268,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 269: to create a request context if needed during tests.","file":"src/flask/ctx.py","line":269,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 523: with app.test_request_context():","file":"src/flask/sansio/scaffold.py","line":523,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 152: :meth:`~flask.Flask.test_request_context` which are directly","file":"src/flask/testing.py","line":152,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 161: ctx = app.test_request_context(*args, **kwargs)","file":"src/flask/testing.py","line":161,"lexical":0.65,"target":false},{"text":"File: tests/conftest.py\nLine 45: with app.test_request_context() as ctx:","file":"tests/conftest.py","line":45,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 34: def test_request_context_means_app_context(app):","file":"tests/test_appctx.py","line":34,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 35: with app.test_request_context():","file":"tests/test_appctx.py","line":35,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 390: with app.test_request_context():","file":"tests/test_basic.py","line":390,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1375: with app.test_request_context():","file":"tests/test_basic.py","line":1375,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1380: with app.test_request_context():","file":"tests/test_basic.py","line":1380,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1395: with app.test_request_context():","file":"tests/test_basic.py","line":1395,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1406: with app.test_request_context():","file":"tests/test_basic.py","line":1406,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"튜토리얼 섹션의 내용을 확인해 줘","query":"tutorial index","file":"docs/tutorial/index.rst","symbol":"Tutorial","line":1,"lang":"ko","candidates":[{"text":"File: docs/index.rst\nLine 16: more detailed :doc:`tutorial/index` that shows how to create a small but","file":"docs/index.rst","line":16,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/index.rst\nLine 44: tutorial/index","file":"docs/index.rst","line":44,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/packages.rst\nLine 18: The :doc:`/tutorial/index` is structured to use the package pattern,","file":"docs/patterns/packages.rst","line":18,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 16: The :doc:`tutorial ` goes over how to write tests for","file":"docs/testing.rst","line":16,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 45: # the tutorial the blog will be the main index","file":"examples/tutorial/flaskr/__init__.py","line":45,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"find tests verifying that global data injection works within templates","query":"template context processor","file":"tests/test_templating.py","symbol":"test_context_processing","line":11,"lang":"en","candidates":[{"text":"File: docs/templating.rst\nLine 199: template context. A context processor is a function that returns a","file":"docs/templating.rst","line":199,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 596: context as well as everything template context processors want","file":"src/flask/app.py","line":596,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 615: if name in self.template_context_processors:","file":"src/flask/app.py","line":615,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 616: for func in self.template_context_processors[name]:","file":"src/flask/app.py","line":616,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 22: T_template_context_processor = t.TypeVar(","file":"src/flask/sansio/blueprints.py","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 23: \"T_template_context_processor\", bound=ft.TemplateContextProcessorCallable","file":"src/flask/sansio/blueprints.py","line":23,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 410: extend(self.template_context_processors, app.template_context_processors)","file":"src/flask/sansio/blueprints.py","line":410,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 645: self, f: T_template_context_processor","file":"src/flask/sansio/blueprints.py","line":645,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 646: ) -> T_template_context_processor:","file":"src/flask/sansio/blueprints.py","line":646,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 647: \"\"\"Like :meth:`context_processor`, but for templates rendered by every view, not","file":"src/flask/sansio/blueprints.py","line":647,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 651: lambda s: s.app.template_context_processors.setdefault(None, []).append(f)","file":"src/flask/sansio/blueprints.py","line":651,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 32: T_template_context_processor = t.TypeVar(","file":"src/flask/sansio/scaffold.py","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 33: \"T_template_context_processor\", bound=ft.TemplateContextProcessorCallable","file":"src/flask/sansio/scaffold.py","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 182: self.template_context_processors: dict[","file":"src/flask/sansio/scaffold.py","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 183: ft.AppOrBlueprintKey, list[ft.TemplateContextProcessorCallable]","file":"src/flask/sansio/scaffold.py","line":183,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 552: f: T_template_context_processor,","file":"src/flask/sansio/scaffold.py","line":552,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 553: ) -> T_template_context_processor:","file":"src/flask/sansio/scaffold.py","line":553,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 554: \"\"\"Registers a template context processor function. These functions run before","file":"src/flask/sansio/scaffold.py","line":554,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 561: and affect every template, use :meth:`.Blueprint.app_context_processor`.","file":"src/flask/sansio/scaffold.py","line":561,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 563: self.template_context_processors[None].append(f)","file":"src/flask/sansio/scaffold.py","line":563,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 22: \"\"\"Default template context processor. Replaces the ``request`` and ``g``","file":"src/flask/templating.py","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/typing.py\nLine 64: TemplateContextProcessorCallable = (","file":"src/flask/typing.py","line":64,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"세션에 저장된 알림 메시지들을 가져와서 리스트로 반환해주는 로직이 어디에 정의되어 있나요? 메시지 내용뿐만 아니라 카테고리별로 필터링하거나 유형을 함께 가져올 수 있는 기능이 필요합니다.","query":"get flashed messages","file":"src/flask/helpers.py","symbol":"get_flashed_messages","line":360,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 1318: - The ``get_flashed_messages`` function now allows rendering flashed","file":"CHANGES.rst","line":1318,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1489: - Don't modify the session on ``get_flashed_messages`` if there are no","file":"CHANGES.rst","line":1489,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 217: .. autofunction:: get_flashed_messages","file":"docs/api.rst","line":217,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 47: {% with messages = get_flashed_messages() %}","file":"docs/patterns/flashing.rst","line":47,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 107: :func:`~flask.get_flashed_messages` function to also return the","file":"docs/patterns/flashing.rst","line":107,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 112: {% with messages = get_flashed_messages(with_categories=true) %}","file":"docs/patterns/flashing.rst","line":112,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 132: :func:`~flask.get_flashed_messages`. This is useful if you wish to","file":"docs/patterns/flashing.rst","line":132,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 137: {% with errors = get_flashed_messages(category_filter=[\"error\"]) %}","file":"docs/patterns/flashing.rst","line":137,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 413: as well as the :func:`~flask.url_for` and :func:`~flask.get_flashed_messages` functions.","file":"docs/quickstart.rst","line":413,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 795: messages you can use :func:`~flask.get_flashed_messages` which is also","file":"docs/quickstart.rst","line":795,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 73: .. function:: get_flashed_messages","file":"docs/templating.rst","line":73,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 76: The :func:`flask.get_flashed_messages` function.","file":"docs/templating.rst","line":76,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/templates.rst\nLine 68: {% for message in get_flashed_messages() %}","file":"docs/tutorial/templates.rst","line":68,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/templates.rst\nLine 81: each message returned by :func:`get_flashed_messages`. You used","file":"docs/tutorial/templates.rst","line":81,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/templates/base.html\nLine 20: {% for message in get_flashed_messages() %}","file":"examples/tutorial/flaskr/templates/base.html","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/__init__.py\nLine 15: from .helpers import get_flashed_messages as get_flashed_messages","file":"src/flask/__init__.py","line":15,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 42: from .helpers import get_flashed_messages","file":"src/flask/app.py","line":42,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 498: get_flashed_messages=get_flashed_messages,","file":"src/flask/app.py","line":498,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 329: the template has to call :func:`get_flashed_messages`.","file":"src/flask/helpers.py","line":329,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/helpers.py\nLine 360: def get_flashed_messages(","file":"src/flask/helpers.py","line":360,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 626: assert list(flask.get_flashed_messages()) == [\"Zap\", \"Zip\"]","file":"tests/test_basic.py","line":626,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 645: messages = flask.get_flashed_messages()","file":"tests/test_basic.py","line":645,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 655: messages = flask.get_flashed_messages(with_categories=True)","file":"tests/test_basic.py","line":655,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 666: messages = flask.get_flashed_messages(","file":"tests/test_basic.py","line":666,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 674: messages = flask.get_flashed_messages(","file":"tests/test_basic.py","line":674,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 685: messages = flask.get_flashed_messages(category_filter=[\"message\", \"warning\"])","file":"tests/test_basic.py","line":685,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"J'ai détecté une vue qui expose une méthode HTTP POST mais ne retourne qu'une simple chaîne de caractères \"POST\". Il faut modifier cette vue pour qu'elle ait un comportement fonctionnel cohérent avec le reste de l'application.","query":"method view post","file":"tests/test_views.py","symbol":"OtherView","line":242,"lang":"fr","candidates":[{"text":"File: docs/extensiondev.rst\nLine 210: class PostAPI(MethodView):","file":"docs/extensiondev.rst","line":210,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 199: A common pattern is to register a view with ``methods=[\"GET\", \"POST\"]``,","file":"docs/views.rst","line":199,"lexical":0.65,"target":false},{"text":"File: tests/test_helpers.py\nLine 150: app.add_url_rule(\"/myview/create\", methods=[\"POST\"], view_func=myview)","file":"tests/test_helpers.py","line":150,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 154: assert flask.url_for(\"myview\", _method=\"POST\") == \"/myview/create\"","file":"tests/test_helpers.py","line":154,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"How do I write serialized data directly to a file stream?","query":"serialize to file","file":"src/flask/json/provider.py","symbol":"dump","line":49,"lang":"en","candidates":[{"text":"File: src/flask/json/__init__.py\nLine 48: \"\"\"Serialize data as JSON and write to a file.","file":"src/flask/json/__init__.py","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/provider.py\nLine 50: \"\"\"Serialize data as JSON and write to a file.","file":"src/flask/json/provider.py","line":50,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"Die Instanziierung der Anwendung in den Tests scheint so zu funktionieren, dass der Name der Flask-Instanz dynamisch aus den übergebenen Parametern zusammengesetzt wird, anstatt einen festen Wert zu verwenden. Das könnte zu Problemen bei der Identifizierung der App führen.","query":"flask app name","file":"tests/test_apps/cliapp/factory.py","symbol":"create_app2","line":8,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 968: named ``flask.app``. The level is only set on first access, it","file":"CHANGES.rst","line":968,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1248: ``flask.Flask.app_ctx_globals_class`` which is a better name to what","file":"CHANGES.rst","line":1248,"lexical":0.44999999999999996,"target":false},{"text":"File: README.md\nLine 26: app = Flask(__name__)","file":"README.md","line":26,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/appcontext.rst\nLine 63: app = Flask(__name__)","file":"docs/appcontext.rst","line":63,"lexical":0.65,"target":false},{"text":"File: docs/blueprints.rst\nLine 92: app = Flask(__name__)","file":"docs/blueprints.rst","line":92,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 330: app = Flask(__name__)","file":"docs/cli.rst","line":330,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 348: app = Flask(__name__)","file":"docs/cli.rst","line":348,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 28: app = Flask(__name__)","file":"docs/config.rst","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 462: app = Flask(__name__)","file":"docs/config.rst","line":462,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 667: app = Flask(__name__)","file":"docs/config.rst","line":667,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 783: app = Flask(__name__, instance_path='/path/to/instance/folder')","file":"docs/config.rst","line":783,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 817: app = Flask(__name__, instance_relative_config=True)","file":"docs/config.rst","line":817,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 823: app = Flask(__name__, instance_relative_config=True)","file":"docs/config.rst","line":823,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/deploying/asgi.rst\nLine 16: app = Flask(__name__)","file":"docs/deploying/asgi.rst","line":16,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/design.rst\nLine 22: app = Flask(__name__)","file":"docs/design.rst","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 316: app = Flask(__name__)","file":"docs/errorhandling.rst","line":316,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 370: app = Flask(__name__)","file":"docs/errorhandling.rst","line":370,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/extensiondev.rst\nLine 82: app = Flask(__name__)","file":"docs/extensiondev.rst","line":82,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/extensions.rst\nLine 30: app = Flask(__name__)","file":"docs/extensions.rst","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 91: app = GeventFlask(__name__)","file":"docs/gevent.rst","line":91,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 21: app = Flask(__name__)","file":"docs/lifecycle.rst","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/logging.rst\nLine 6: which takes the same name as :attr:`app.name `. This","file":"docs/logging.rst","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/logging.rst\nLine 56: app = Flask(__name__)","file":"docs/logging.rst","line":56,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/logging.rst\nLine 182: :meth:`app.logger ` or its own named logger. Consult each","file":"docs/logging.rst","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 29: app = Flask(__name__)","file":"docs/patterns/appdispatch.rst","line":29,"lexical":0.65,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 28: app = Flask(__name__)","file":"docs/patterns/appfactories.rst","line":28,"lexical":0.65,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 65: app = Flask(__name__)","file":"docs/patterns/appfactories.rst","line":65,"lexical":0.65,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 77: app = Flask(__name__)","file":"docs/patterns/appfactories.rst","line":77,"lexical":0.65,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 52: celery_app = Celery(app.name, task_cls=FlaskTask)","file":"docs/patterns/celery.rst","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 74: app = Flask(__name__)","file":"docs/patterns/celery.rst","line":74,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 108: app = Flask(__name__)","file":"docs/patterns/celery.rst","line":108,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 28: app = Flask(__name__)","file":"docs/patterns/fileuploads.rst","line":28,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"O teste está definindo uma sessão temporária, mas não a fecha. Adiciona o parâmetro permanent ao método de sessão com base em um parâmetro da função de teste.","query":"flask session permanent","file":"tests/test_basic.py","symbol":"index","line":428,"lang":"pt","candidates":[{"text":"File: docs/api.rst\nLine 120: The :attr:`~flask.Flask.permanent_session_lifetime` attribute is always a","file":"docs/api.rst","line":120,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/web-security.rst\nLine 245: For the session cookie, if :attr:`session.permanent `","file":"docs/web-security.rst","line":245,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 430: flask.session.permanent = permanent","file":"tests/test_basic.py","line":430,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_basic.py\nLine 435: return str(flask.session.permanent)","file":"tests/test_basic.py","line":435,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 507: flask.session.permanent = is_permanent","file":"tests/test_basic.py","line":507,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 607: flask.session.permanent = True","file":"tests/test_basic.py","line":607,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"The instruction manual for the demonstration scenarios is missing the actual code snippets or procedural steps intended for the user to follow during the walkthrough.","query":"tutorial examples","file":"examples/tutorial/README.rst","symbol":"Test","line":56,"lang":"en","candidates":[{"text":"File: docs/patterns/packages.rst\nLine 19: see the :gh:`example code `.","file":"docs/patterns/packages.rst","line":19,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/index.rst\nLine 61: repository `, if you want to compare your project","file":"docs/tutorial/index.rst","line":61,"lexical":0.5,"target":false},{"text":"File: docs/tutorial/next.rst\nLine 7: :gh:`example project `, which might look a bit","file":"docs/tutorial/next.rst","line":7,"lexical":0.5,"target":false},{"text":"File: docs/tutorial/static.rst\nLine 56: :gh:`example code `.","file":"docs/tutorial/static.rst","line":56,"lexical":0.5,"target":false},{"text":"File: examples/tutorial/README.rst\nLine 22: $ cd examples/tutorial","file":"examples/tutorial/README.rst","line":22,"lexical":0.5,"target":true}]} {"site":"project_search","repo":"flask","task":"O teste falha quando o parâmetro de consulta na URL não é fornecido, causando um erro de chave ausente ao tentar renderizar a saudação dinâmica.","query":"flask request args","file":"tests/test_reqctx.py","symbol":"index","line":136,"lang":"pt","candidates":[{"text":"File: docs/patterns/wtforms.rst\nLine 65: :attr:`~flask.request.args` if the data is submitted as ``GET``.","file":"docs/patterns/wtforms.rst","line":65,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 147: name = request.args.get(\"name\", \"Flask\")","file":"docs/quickstart.rst","line":147,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 234: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":234,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 248: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":248,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 278: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":278,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 109: return f\"Hello {flask.request.args['name']}!\"","file":"tests/test_reqctx.py","line":109,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_reqctx.py\nLine 137: return f\"Hello {flask.request.args['name']}!\"","file":"tests/test_reqctx.py","line":137,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 162: assert flask.request.args[\"foo\"] == \"bar\"","file":"tests/test_reqctx.py","line":162,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 262: assert \"vodka\" in flask.request.args","file":"tests/test_testing.py","line":262,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"'create_app' 함수가 테스트 구성 설정을 받지 않았을 때는 테스트 모드가 비활성화되어야 하고, 'TESTING': True 설정을 전달받았을 때는 활성화되어야 하는지 확인합니다.","query":"app testing config","file":"examples/tutorial/tests/test_factory.py","symbol":"test_config","line":4,"lang":"ko","candidates":[{"text":"File: docs/config.rst\nLine 29: app.config['TESTING'] = True","file":"docs/config.rst","line":29,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 64: configure the application and database for testing instead of using your","file":"docs/tutorial/tests.rst","line":64,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"如何应用工厂模式来创建Flask应用?","query":"app factory","file":"docs/patterns/appfactories.rst","symbol":"Application Factories","line":1,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 437: - The CLI does not pass ``script_info`` to app factory functions.","file":"CHANGES.rst","line":437,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 587: - Passing ``script_info`` to app factory functions is deprecated. This","file":"CHANGES.rst","line":587,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 605: - When specifying a factory function with ``FLASK_APP``, keyword","file":"CHANGES.rst","line":605,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 895: - Auto-detect zero-argument app factory called ``create_app`` or","file":"CHANGES.rst","line":895,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 901: - ``FLASK_APP`` can be set to an app factory, with arguments if","file":"CHANGES.rst","line":901,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 184: it can't be imported, such as when using the application factory pattern or","file":"docs/api.rst","line":184,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/appcontext.rst\nLine 26: :doc:`app factory pattern ` or writing reusable","file":"docs/appcontext.rst","line":26,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/cli.rst\nLine 27: factory (``create_app`` or ``make_app``).","file":"docs/cli.rst","line":27,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/cli.rst\nLine 31: or ``application``) or factory (``create_app`` or ``make_app``).","file":"docs/cli.rst","line":31,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/cli.rst\nLine 51: The ``create_app`` factory in ``hello`` is called with the string ``'dev'``","file":"docs/cli.rst","line":51,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/cli.rst\nLine 60: found, the command looks for a factory function named ``create_app`` or","file":"docs/cli.rst","line":60,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/cli.rst\nLine 476: When you are using the app factory pattern, it may be more convenient to define","file":"docs/cli.rst","line":476,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/gevent.rst\nLine 42: ``WSGIServer``, as well as your app or app factory.","file":"docs/deploying/gevent.rst","line":42,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/gunicorn.rst\nLine 47: app factory pattern.","file":"docs/deploying/gunicorn.rst","line":47,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/mod_wsgi.rst\nLine 48: if using the app factory pattern.","file":"docs/deploying/mod_wsgi.rst","line":48,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/uwsgi.rst\nLine 69: If you're using the app factory pattern, you'll need to create a small","file":"docs/deploying/uwsgi.rst","line":69,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/waitress.rst\nLine 42: the variable with the application. If you're using the app factory","file":"docs/deploying/waitress.rst","line":42,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/extensiondev.rst\nLine 72: This allows the extension to support the application factory pattern,","file":"docs/extensiondev.rst","line":72,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 104: Then the ``create_app`` factory in ``hello`` is called with the keyword","file":"docs/patterns/appfactories.rst","line":104,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/patterns/celery.rst\nLine 98: Application Factory","file":"docs/patterns/celery.rst","line":98,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 101: When using the Flask application factory pattern, call the ``celery_init_app`` function","file":"docs/patterns/celery.rst","line":101,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 102: inside the factory. It sets ``app.extensions[\"celery\"]`` to the Celery app object, which","file":"docs/patterns/celery.rst","line":102,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 103: can be used to get the Celery app from the Flask app returned by the factory.","file":"docs/patterns/celery.rst","line":103,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 143: ``celery_app`` object, which won't be available when using the factory pattern. It also","file":"docs/patterns/celery.rst","line":143,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 45: :doc:`application factory `, define an ``app``","file":"docs/testing.rst","line":45,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 50: If you're not using a factory, you already have an app object you can","file":"docs/testing.rst","line":50,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 18: Define the blueprint and register it in the application factory.","file":"docs/tutorial/blog.rst","line":18,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 35: new code at the end of the factory function before returning the app.","file":"docs/tutorial/blog.rst","line":35,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 70: application handling the request. Since you used an application factory,","file":"docs/tutorial/database.rst","line":70,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 161: application. However, since you're using a factory function, that","file":"docs/tutorial/database.rst","line":161,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 180: the end of the factory function before returning the app.","file":"docs/tutorial/database.rst","line":180,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Peux-tu me montrer où on simule l'ajout de données dans le contexte lors de l'enregistrement d'un signal ?","query":"record context template","file":"tests/test_signals.py","symbol":"record","line":34,"lang":"fr","candidates":[{"text":"File: docs/signals.rst\nLine 51: def record(sender, template, context, **extra):","file":"docs/signals.rst","line":51,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/signals.rst\nLine 52: recorded.append((template, context))","file":"docs/signals.rst","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/signals.rst\nLine 86: def record(sender, template, context):","file":"docs/signals.rst","line":86,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/signals.rst\nLine 87: recorded.append((template, context))","file":"docs/signals.rst","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 11: def record(sender, template, context):","file":"tests/test_signals.py","line":11,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_signals.py\nLine 12: recorded.append((template, context))","file":"tests/test_signals.py","line":12,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 18: template, context = recorded[0]","file":"tests/test_signals.py","line":18,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 34: def record(sender, template, context):","file":"tests/test_signals.py","line":34,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 36: recorded.append((template, context))","file":"tests/test_signals.py","line":36,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 42: template, context = recorded[0]","file":"tests/test_signals.py","line":42,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Verify that attempting to access a view function after the associated request environment has been popped from the stack results in a runtime error.","query":"test manual context","file":"tests/test_reqctx.py","symbol":"test_manual_context_binding","line":134,"lang":"en","candidates":[{"text":"File: src/flask/sansio/scaffold.py\nLine 519: contexts may be pushed manually during testing.","file":"src/flask/sansio/scaffold.py","line":519,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 134: def test_manual_context_binding(app):","file":"tests/test_reqctx.py","line":134,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"flaskのリクエストエンドポイントを取得する関数を作る","query":"request endpoint","file":"tests/test_blueprints.py","symbol":"bar_foo","line":299,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 640: ``request.endpoint``. :issue:`3776`","file":"CHANGES.rst","line":640,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 53: blueprints when dispatching requests and generating URLs from one endpoint","file":"docs/blueprints.rst","line":53,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 145: template_name = f\"{request.endpoint.replace('.', '/')}.html\"","file":"docs/patterns/viewdecorators.rst","line":145,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1166: # If the endpoint starts with \".\" and the request matches a","file":"src/flask/app.py","line":1166,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1311: f\"The view function for {request.endpoint!r} did not\"","file":"src/flask/app.py","line":1311,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 970: # passed endpoint instead of using request.blueprints.","file":"src/flask/sansio/app.py","line":970,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/wrappers.py\nLine 148: \"\"\"The endpoint that matched the request URL.","file":"src/flask/wrappers.py","line":148,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1747: return flask.request.endpoint","file":"tests/test_basic.py","line":1747,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1751: return flask.request.endpoint","file":"tests/test_basic.py","line":1751,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1755: return flask.request.endpoint","file":"tests/test_basic.py","line":1755,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 288: return flask.request.endpoint","file":"tests/test_blueprints.py","line":288,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_blueprints.py\nLine 292: return flask.request.endpoint","file":"tests/test_blueprints.py","line":292,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 296: return flask.request.endpoint","file":"tests/test_blueprints.py","line":296,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 300: return flask.request.endpoint","file":"tests/test_blueprints.py","line":300,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 306: return flask.request.endpoint","file":"tests/test_blueprints.py","line":306,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 342: return flask.request.endpoint","file":"tests/test_blueprints.py","line":342,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1092: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1092,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1104: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1104,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_session_interface.py\nLine 7: \"\"\"If request.endpoint (or other URL matching behavior) is needed","file":"tests/test_session_interface.py","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_session_interface.py\nLine 18: assert request.endpoint is not None","file":"tests/test_session_interface.py","line":18,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"テスト内でWebフレームワークのインスタンスを直接生成しており、アプリケーション全体の設定がテストごとに独立できていない可能性があります。","query":"Flask app instance","file":"tests/test_cli.py","symbol":"Module","line":48,"lang":"ja","candidates":[{"text":"File: docs/api.rst\nLine 157: app context. An instance of :attr:`.Flask.app_ctx_globals_class`, which","file":"docs/api.rst","line":157,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 48: Uses the ``app2`` Flask instance in ``hello``.","file":"docs/cli.rst","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 783: app = Flask(__name__, instance_path='/path/to/instance/folder')","file":"docs/config.rst","line":783,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 817: app = Flask(__name__, instance_relative_config=True)","file":"docs/config.rst","line":817,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 823: app = Flask(__name__, instance_relative_config=True)","file":"docs/config.rst","line":823,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/design.rst\nLine 15: instance of the :class:`~flask.Flask` class. Each Flask application has","file":"docs/design.rst","line":15,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 14: Flask application is an instance of the :class:`.Flask` class, which collects all","file":"docs/lifecycle.rst","line":14,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 144: means that the decorated tasks are tied to the specific Flask and Celery app instances,","file":"docs/patterns/celery.rst","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 6: A Flask application is an instance of the :class:`Flask` class.","file":"docs/tutorial/factory.rst","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 45: app = Flask(__name__, instance_relative_config=True)","file":"docs/tutorial/factory.rst","line":45,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 48: DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),","file":"docs/tutorial/factory.rst","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 71: #. ``app = Flask(__name__, instance_relative_config=True)`` creates the","file":"docs/tutorial/factory.rst","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 95: :attr:`app.instance_path `, which is the","file":"docs/tutorial/factory.rst","line":95,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 110: :attr:`app.instance_path ` exists. Flask","file":"docs/tutorial/factory.rst","line":110,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 7: \"\"\"Create and configure an instance of the Flask application.\"\"\"","file":"examples/tutorial/flaskr/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 8: app = Flask(__name__, instance_relative_config=True)","file":"examples/tutorial/flaskr/__init__.py","line":8,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 13: DATABASE=os.path.join(app.instance_path, \"flaskr.sqlite\"),","file":"examples/tutorial/flaskr/__init__.py","line":13,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 51: if isinstance(app, Flask):","file":"src/flask/cli.py","line":51,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 74: if isinstance(app, Flask):","file":"src/flask/cli.py","line":74,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 191: if isinstance(app, Flask):","file":"src/flask/cli.py","line":191,"lexical":0.55,"target":false},{"text":"File: src/flask/json/provider.py\nLine 30: :attr:`app.json ` to an instance of the class.","file":"src/flask/json/provider.py","line":30,"lexical":0.55,"target":false},{"text":"File: tests/test_cli.py\nLine 69: assert isinstance(app, Flask)","file":"tests/test_cli.py","line":69,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_cli.py\nLine 78: assert isinstance(app, Flask)","file":"tests/test_cli.py","line":78,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 87: assert isinstance(app, Flask)","file":"tests/test_cli.py","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_instance_config.py\nLine 12: app = flask.Flask(__name__, instance_path=os.fspath(modules_tmp_path))","file":"tests/test_instance_config.py","line":12,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"这个测试用例里返回 HTTP 请求方法的函数是干什么的?","query":"flask request method","file":"tests/test_basic.py","symbol":"index","line":134,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 12: - Many ``Flask`` methods involved in request dispatch now take the current","file":"CHANGES.rst","line":12,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 258: For example, here we use the :meth:`~flask.Flask.test_request_context` method","file":"docs/quickstart.rst","line":258,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 22: using the :attr:`~flask.Flask.test_request_context` method which creates","file":"docs/shell.rst","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 135: return flask.request.method","file":"tests/test_basic.py","line":135,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_basic.py\nLine 139: return flask.request.method","file":"tests/test_basic.py","line":139,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 164: return flask.request.method","file":"tests/test_basic.py","line":164,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 167: return flask.request.method","file":"tests/test_basic.py","line":167,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_views.py\nLine 22: return flask.request.method","file":"tests/test_views.py","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_views.py\nLine 155: return flask.Response(\"Blub\", headers={\"X-Method\": flask.request.method})","file":"tests/test_views.py","line":155,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_views.py\nLine 189: return flask.request.method","file":"tests/test_views.py","line":189,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"O servidor de desenvolvimento local não está carregando as variáveis de ambiente do arquivo .env quando o método de inicialização é chamado, mesmo com a opção de carregamento ativada por padrão.","query":"run dotenv","file":"src/flask/app.py","symbol":"run","line":633,"lang":"pt","candidates":[{"text":"File: docs/cli.rst\nLine 163: If `python-dotenv`_ is installed, running the ``flask`` command will set","file":"docs/cli.rst","line":163,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/installation.rst\nLine 42: * `python-dotenv`_ enables support for :ref:`dotenv` when running ``flask``","file":"docs/installation.rst","line":42,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 577: def test_disable_dotenv_from_env(monkeypatch, runner):","file":"tests/test_cli.py","line":577,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Estou tentando entender como o framework lida com a escrita de dados serializados diretamente em arquivos. Onde está a função que decide se usa o provedor de JSON do app atual ou o módulo padrão do Python?","query":"serialize to file","file":"src/flask/json/__init__.py","symbol":"dump","line":47,"lang":"pt","candidates":[{"text":"File: src/flask/json/__init__.py\nLine 48: \"\"\"Serialize data as JSON and write to a file.","file":"src/flask/json/__init__.py","line":48,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/json/provider.py\nLine 50: \"\"\"Serialize data as JSON and write to a file.","file":"src/flask/json/provider.py","line":50,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"how do I convert a datetime to a standard HTTP date string?","query":"http_date","file":"src/flask/json/tag.py","symbol":"to_json","line":212,"lang":"en","candidates":[{"text":"File: src/flask/json/provider.py\nLine 11: from werkzeug.http import http_date","file":"src/flask/json/provider.py","line":11,"lexical":0.35,"target":false},{"text":"File: src/flask/json/provider.py\nLine 110: return http_date(o)","file":"src/flask/json/provider.py","line":110,"lexical":0.35,"target":false},{"text":"File: src/flask/json/tag.py\nLine 53: from werkzeug.http import http_date","file":"src/flask/json/tag.py","line":53,"lexical":0.35,"target":true},{"text":"File: src/flask/json/tag.py\nLine 213: return http_date(value)","file":"src/flask/json/tag.py","line":213,"lexical":0.35,"target":false},{"text":"File: tests/test_json.py\nLine 7: from werkzeug.http import http_date","file":"tests/test_json.py","line":7,"lexical":0.35,"target":false},{"text":"File: tests/test_json.py\nLine 142: assert r.json[\"value\"] == http_date(value)","file":"tests/test_json.py","line":142,"lexical":0.35,"target":false}]} {"site":"project_search","repo":"flask","task":"flask 앱 객체를 반환하는 정적 메서드 찾기","query":"flask create app","file":"tests/test_cli.py","symbol":"Module","line":63,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 902: needed, for example ``FLASK_APP=myproject.app:create_app('dev')``.","file":"CHANGES.rst","line":902,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 492: @click.group(cls=FlaskGroup, create_app=create_app)","file":"docs/cli.rst","line":492,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 102: $ flask --app 'hello:create_app(local_auth=True)' run","file":"docs/patterns/appfactories.rst","line":102,"lexical":0.65,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 39: and registers tasks. While creating a Flask app, use the following code to create and","file":"docs/patterns/celery.rst","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 107: def create_app() -> Flask:","file":"docs/patterns/celery.rst","line":107,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 128: flask_app = create_app()","file":"docs/patterns/celery.rst","line":128,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 100: $ waitress-serve --call 'flaskr:create_app'","file":"docs/tutorial/deploy.rst","line":100,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 10: The most straightforward way to create a Flask application is to create","file":"docs/tutorial/factory.rst","line":10,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 71: #. ``app = Flask(__name__, instance_relative_config=True)`` creates the","file":"docs/tutorial/factory.rst","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 115: #. :meth:`@app.route() ` creates a simple route so you can","file":"docs/tutorial/factory.rst","line":115,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 74: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":74,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 150: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":150,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/make_celery.py\nLine 3: flask_app = create_app()","file":"examples/celery/make_celery.py","line":3,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/src/task_app/__init__.py\nLine 7: def create_app() -> Flask:","file":"examples/celery/src/task_app/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 7: \"\"\"Create and configure an instance of the Flask application.\"\"\"","file":"examples/tutorial/flaskr/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 6: from flaskr import create_app","file":"examples/tutorial/tests/conftest.py","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_factory.py\nLine 1: from flaskr import create_app","file":"examples/tutorial/tests/test_factory.py","line":1,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 308: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":308,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 566: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":566,"lexical":0.55,"target":false},{"text":"File: src/flask/ctx.py\nLine 267: Do not use this class directly. Use :meth:`.Flask.app_context` to create an","file":"src/flask/ctx.py","line":267,"lexical":0.55,"target":false},{"text":"File: tests/test_cli.py\nLine 265: return Flask(\"createapp\")","file":"tests/test_cli.py","line":265,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_cli.py\nLine 301: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":301,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 312: obj = ScriptInfo(create_app=lambda: Flask(\"testapp\"))","file":"tests/test_cli.py","line":312,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 336: obj = ScriptInfo(create_app=lambda: Flask(\"testappgroup\"))","file":"tests/test_cli.py","line":336,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 351: @click.group(cls=FlaskGroup, create_app=create_app)","file":"tests/test_cli.py","line":351,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 371: @click.group(cls=FlaskGroup, create_app=create_app, set_debug_flag=set_debug_flag)","file":"tests/test_cli.py","line":371,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 386: flask_group = FlaskGroup(name=\"flask\", create_app=lambda: app)","file":"tests/test_cli.py","line":386,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 431: cli = FlaskGroup(create_app=create_app)","file":"tests/test_cli.py","line":431,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 459: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":459,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 497: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":497,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"テンプレートのテスト関数をアプリに登録するためのデコレータの処理はどうなってる?","query":"app template test","file":"src/flask/sansio/blueprints.py","symbol":"decorator","line":525,"lang":"ja","candidates":[{"text":"File: examples/javascript/tests/test_js_example.py\nLine 14: def test_index(app, client, path, template_name):","file":"examples/javascript/tests/test_js_example.py","line":14,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 728: @app.template_test(\"prime\")","file":"src/flask/sansio/app.py","line":728,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 498: def app_template_test(self, name: T_template_test) -> T_template_test: ...","file":"src/flask/sansio/blueprints.py","line":498,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 500: def app_template_test(","file":"src/flask/sansio/blueprints.py","line":500,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 504: def app_template_test(","file":"src/flask/sansio/blueprints.py","line":504,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 510: The :meth:`add_app_template_test` method may be used to register a","file":"src/flask/sansio/blueprints.py","line":510,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 522: self.add_app_template_test(name)","file":"src/flask/sansio/blueprints.py","line":522,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 526: self.add_app_template_test(f, name=name)","file":"src/flask/sansio/blueprints.py","line":526,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 532: def add_app_template_test(","file":"src/flask/sansio/blueprints.py","line":532,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 537: The :meth:`app_template_test` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":537,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 551: state.app.add_template_test(f, name=name)","file":"src/flask/sansio/blueprints.py","line":551,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 175: def test_templates_and_static(test_apps):","file":"tests/test_blueprints.py","line":175,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 235: def test_templates_list(test_apps):","file":"tests/test_blueprints.py","line":235,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 350: def test_template_filter(app):","file":"tests/test_blueprints.py","line":350,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 387: def test_add_template_filter(app):","file":"tests/test_blueprints.py","line":387,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 400: def test_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":400,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 413: def test_add_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":413,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 426: def test_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":426,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 443: def test_template_filter_after_route_with_template(app, client):","file":"tests/test_blueprints.py","line":443,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 459: def test_add_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":459,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 476: def test_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":476,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 493: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":493,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 510: def test_template_test(app):","file":"tests/test_blueprints.py","line":510,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 513: @bp.app_template_test()","file":"tests/test_blueprints.py","line":513,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 517: @bp.app_template_test","file":"tests/test_blueprints.py","line":517,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 521: @bp.app_template_test(\"my_boolean_custom_name\")","file":"tests/test_blueprints.py","line":521,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 525: @bp.app_template_test(name=\"my_boolean_custom_name_2\")","file":"tests/test_blueprints.py","line":525,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 547: def test_add_template_test(app):","file":"tests/test_blueprints.py","line":547,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 553: bp.add_app_template_test(is_boolean)","file":"tests/test_blueprints.py","line":553,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 560: def test_template_test_with_name(app):","file":"tests/test_blueprints.py","line":560,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 563: @bp.app_template_test(\"boolean\")","file":"tests/test_blueprints.py","line":563,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 573: def test_add_template_test_with_name(app):","file":"tests/test_blueprints.py","line":573,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"我在写请求上下文相关的测试用例,帮我找一下那个在请求结束时把异常存进缓存里的逻辑。我想看看它是怎么处理异常记录的。","query":"append exception buffer","file":"tests/test_reqctx.py","symbol":"end_of_request","line":19,"lang":"zh","candidates":[{"text":"File: tests/test_reqctx.py\nLine 20: buffer.append(exception)","file":"tests/test_reqctx.py","line":20,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_reqctx.py\nLine 34: buffer.append(exception)","file":"tests/test_reqctx.py","line":34,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 51: buffer.append(exception)","file":"tests/test_reqctx.py","line":51,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"ドキュメントの構成を確認しています。ユーザー向けの使い方の説明がどこに記載されているか教えてください。","query":"user guide","file":"docs/index.rst","symbol":"User's Guide","line":31,"lang":"ja","candidates":[{"text":"File: docs/index.rst\nLine 31: User's Guide","file":"docs/index.rst","line":31,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/patterns/celery.rst\nLine 64: .. _configuration: https://celery.readthedocs.io/en/stable/userguide/configuration.html","file":"docs/patterns/celery.rst","line":64,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Implementez la fonction pour importer et enregistrer dynamiquement les commandes Flask provenant des plugins externes. Assurez-vous que ce chargement ne se produit qu'une seule fois pour éviter les duplications.","query":"load plugin commands","file":"src/flask/cli.py","symbol":"_load_plugin_commands","line":600,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 63: - ``flask --help`` loads the app and plugins first to make sure all commands","file":"CHANGES.rst","line":63,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 598: self._loaded_plugin_commands = False","file":"src/flask/cli.py","line":598,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/cli.py\nLine 600: def _load_plugin_commands(self) -> None:","file":"src/flask/cli.py","line":600,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 601: if self._loaded_plugin_commands:","file":"src/flask/cli.py","line":601,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 607: self._loaded_plugin_commands = True","file":"src/flask/cli.py","line":607,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 610: self._load_plugin_commands()","file":"src/flask/cli.py","line":610,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 637: self._load_plugin_commands()","file":"src/flask/cli.py","line":637,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"verificar que la configuración de rutas y nombres de importación sea correcta tras ejecutar la preparación","query":"prepare import path","file":"tests/test_cli.py","symbol":"test_prepare_import","line":160,"lang":"es","candidates":[{"text":"File: src/flask/cli.py\nLine 200: def prepare_import(path: str) -> str:","file":"src/flask/cli.py","line":200,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 348: import_name = prepare_import(path)","file":"src/flask/cli.py","line":348,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 352: import_name = prepare_import(path)","file":"src/flask/cli.py","line":352,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 160: def test_prepare_import(request, value, path, result):","file":"tests/test_cli.py","line":160,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"Comment est-ce qu'on construit les liens vers les ressources dans le projet ?","query":"url generation","file":"docs/patterns/javascript.rst","symbol":"Generating URLs","line":62,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 1332: also adds support for URL generation without an active request","file":"CHANGES.rst","line":1332,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 10: def test_basic_url_generation(app):","file":"tests/test_appctx.py","line":10,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 23: def test_url_generation_requires_server_name(app):","file":"tests/test_appctx.py","line":23,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 29: def test_url_generation_without_context_fails():","file":"tests/test_appctx.py","line":29,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1361: def test_url_generation(app, req_ctx):","file":"tests/test_basic.py","line":1361,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"devuelve el nombre del método webdav para la prueba de vistas","query":"PROPFIND method","file":"tests/test_views.py","symbol":"propfind","line":208,"lang":"es","candidates":[{"text":"File: tests/test_views.py\nLine 202: methods = [\"GET\", \"PROPFIND\"]","file":"tests/test_views.py","line":202,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_views.py\nLine 214: assert client.open(\"/\", method=\"PROPFIND\").data == b\"PROPFIND\"","file":"tests/test_views.py","line":214,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 215: assert ChildView.methods == {\"PROPFIND\", \"GET\"}","file":"tests/test_views.py","line":215,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"setup the command line interface testing environment","query":"cli runner","file":"tests/test_cli.py","symbol":"runner","line":36,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 62: - Fix type hint for ``cli_runner.invoke``. :issue:`5645`","file":"CHANGES.rst","line":62,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 983: - Added ``Flask.test_cli_runner`` to create a Click runner that can","file":"CHANGES.rst","line":983,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 133: Test CLI Runner","file":"docs/api.rst","line":133,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 138: .. autoclass:: FlaskCliRunner","file":"docs/api.rst","line":138,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 41: test client, and CLI runner are shown below, they can be placed in","file":"docs/testing.rst","line":41,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 80: return app.test_cli_runner()","file":"docs/testing.rst","line":80,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 245: Running Commands with the CLI Runner","file":"docs/testing.rst","line":245,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 248: Flask provides :meth:`~flask.Flask.test_cli_runner` to create a","file":"docs/testing.rst","line":248,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 249: :class:`~flask.testing.FlaskCliRunner`, which runs CLI commands in","file":"docs/testing.rst","line":249,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 251: object. Flask's runner extends :doc:`Click's runner `,","file":"docs/testing.rst","line":251,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 254: Use the runner's :meth:`~flask.testing.FlaskCliRunner.invoke` method to","file":"docs/testing.rst","line":254,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 107: return app.test_cli_runner()","file":"docs/tutorial/tests.rst","line":107,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 125: The ``runner`` fixture is similar to ``client``.","file":"docs/tutorial/tests.rst","line":125,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 43: \"\"\"A test runner for the app's Click commands.\"\"\"","file":"examples/tutorial/tests/conftest.py","line":43,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 44: return app.test_cli_runner()","file":"examples/tutorial/tests/conftest.py","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 62: from .testing import FlaskCliRunner","file":"src/flask/app.py","line":62,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 816: def test_cli_runner(self, **kwargs: t.Any) -> FlaskCliRunner:","file":"src/flask/app.py","line":816,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 817: \"\"\"Create a CLI runner for testing CLI commands.","file":"src/flask/app.py","line":817,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 820: Returns an instance of :attr:`test_cli_runner_class`, by default","file":"src/flask/app.py","line":820,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 821: :class:`~flask.testing.FlaskCliRunner`. The Flask app object is","file":"src/flask/app.py","line":821,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 826: cls = self.test_cli_runner_class","file":"src/flask/app.py","line":826,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 829: from .testing import FlaskCliRunner as cls","file":"src/flask/app.py","line":829,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 40: from ..testing import FlaskCliRunner","file":"src/flask/sansio/app.py","line":40,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 268: #: The :class:`~click.testing.CliRunner` subclass, by default","file":"src/flask/sansio/app.py","line":268,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 269: #: :class:`~flask.testing.FlaskCliRunner` that is used by","file":"src/flask/sansio/app.py","line":269,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 270: #: :meth:`test_cli_runner`. Its ``__init__`` method should take a","file":"src/flask/sansio/app.py","line":270,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 274: test_cli_runner_class: type[FlaskCliRunner] | None = None","file":"src/flask/sansio/app.py","line":274,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/testing.py\nLine 12: from click.testing import CliRunner","file":"src/flask/testing.py","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/testing.py\nLine 265: class FlaskCliRunner(CliRunner):","file":"src/flask/testing.py","line":265,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/testing.py\nLine 266: \"\"\"A :class:`~click.testing.CliRunner` for testing a Flask app's","file":"src/flask/testing.py","line":266,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/testing.py\nLine 268: :meth:`~flask.Flask.test_cli_runner`. See :ref:`testing-cli`.","file":"src/flask/testing.py","line":268,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Flaskの構成設定を継承しているクラスはどこに定義されていますか?","query":"flask Config class","file":"tests/test_config.py","symbol":"Config","line":199,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 1113: - Added ``Flask.config_class``.","file":"CHANGES.rst","line":1113,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 16: The :attr:`~flask.Flask.config` attribute of the :class:`~flask.Flask`","file":"docs/config.rst","line":16,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 25: The :attr:`~flask.Flask.config` is actually a subclass of a dictionary and","file":"docs/config.rst","line":25,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 518: complete reference, read the :class:`~flask.Config` object's","file":"docs/config.rst","line":518,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 704: Note that :meth:`~flask.Config.from_object` does not instantiate the class","file":"docs/config.rst","line":704,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 185: #: Defaults to :class:`~flask.Config`.","file":"src/flask/sansio/app.py","line":185,"lexical":0.55,"target":false},{"text":"File: tests/test_config.py\nLine 199: class Config(flask.Config):","file":"tests/test_config.py","line":199,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"FlaskのSansIO実装で、テンプレートエンジンを初期化するためのインターフェースを定義したいです。このメソッドがどのように実装されるべきか、設計のヒントを教えてください。","query":"jinja environment","file":"src/flask/sansio/app.py","symbol":"create_jinja_environment","line":476,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 949: ``Flask.create_jinja_environment`` instead.","file":"CHANGES.rst","line":949,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1159: - Allow custom Jinja environment subclasses. :pr:`1422`","file":"CHANGES.rst","line":1159,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1422: - Fixed the Jinja environment's ``list_templates`` method not","file":"CHANGES.rst","line":1422,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1484: ``Flask.create_jinja_environment`` method instead to achieve the","file":"CHANGES.rst","line":1484,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 58: - Setting up the Jinja template environment with ``app.jinja_env``.","file":"docs/lifecycle.rst","line":58,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/templating.rst\nLine 189: The Jinja environment is also available as :attr:`~.Flask.jinja_env`. It may be","file":"docs/templating.rst","line":189,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 470: def create_jinja_environment(self) -> Environment:","file":"src/flask/app.py","line":470,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 471: \"\"\"Create the Jinja environment based on :attr:`jinja_options`","file":"src/flask/app.py","line":471,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 495: rv = self.jinja_environment(self, **options)","file":"src/flask/app.py","line":495,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 166: #: The class that is used for the Jinja environment.","file":"src/flask/sansio/app.py","line":166,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 169: jinja_environment = Environment","file":"src/flask/sansio/app.py","line":169,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 239: #: Options that are passed to the Jinja environment in","file":"src/flask/sansio/app.py","line":239,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 240: #: :meth:`create_jinja_environment`. Changing these options after","file":"src/flask/sansio/app.py","line":240,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 241: #: the environment is created (accessing :attr:`jinja_env`) will","file":"src/flask/sansio/app.py","line":241,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 467: def jinja_env(self) -> Environment:","file":"src/flask/sansio/app.py","line":467,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 468: \"\"\"The Jinja environment used to load templates.","file":"src/flask/sansio/app.py","line":468,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 474: return self.create_jinja_environment()","file":"src/flask/sansio/app.py","line":474,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 476: def create_jinja_environment(self) -> Environment:","file":"src/flask/sansio/app.py","line":476,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 521: \"\"\"Creates the loader for the Jinja environment. Can be used to","file":"src/flask/sansio/app.py","line":521,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/templating.py\nLine 6: from jinja2 import Environment as BaseEnvironment","file":"src/flask/templating.py","line":6,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/templating.py\nLine 37: \"\"\"Works like a regular Jinja environment but has some additional","file":"src/flask/templating.py","line":37,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 529: jinja_environment = CustomEnvironment","file":"tests/test_templating.py","line":529,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 532: assert isinstance(app.jinja_env, CustomEnvironment)","file":"tests/test_templating.py","line":532,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"블루프린트를 통해 등록된 애플리케이션 템플릿 필터가 실제 Jinja2 환경에 정상적으로 반영되고 동작하는지 확인하는 테스트 케이스가 있는지 확인해주세요.","query":"blueprint template filter","file":"tests/test_blueprints.py","symbol":"test_add_template_filter","line":387,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 1312: - Blueprints now have a decorator to add custom template filters","file":"CHANGES.rst","line":1312,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1313: application wide, ``Blueprint.app_template_filter``.","file":"CHANGES.rst","line":1313,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1317: ``Blueprint.add_app_template_filter``.","file":"CHANGES.rst","line":1317,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 460: blueprint. Equivalent to :meth:`.Flask.template_filter`.","file":"src/flask/sansio/blueprints.py","line":460,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 485: blueprint. Equivalent to :meth:`.Flask.add_template_filter`.","file":"src/flask/sansio/blueprints.py","line":485,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 492: def register_template_filter(state: BlueprintSetupState) -> None:","file":"src/flask/sansio/blueprints.py","line":492,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"获取当前请求的完整URL","query":"request url","file":"tests/test_testing.py","symbol":"index","line":20,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 779: - URL matching now occurs after the request context is pushed, rather","file":"CHANGES.rst","line":779,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1177: in the test client when absolute URLs were requested.","file":"CHANGES.rst","line":1177,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1332: also adds support for URL generation without an active request","file":"CHANGES.rst","line":1332,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 416: f\"SecurityException at {request.url!r}\",","file":"docs/api.rst","line":416,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 53: blueprints when dispatching requests and generating URLs from one endpoint","file":"docs/blueprints.rst","line":53,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 316: Use this scheme for generating external URLs when not in a request context.","file":"docs/config.rst","line":316,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 89: request URL is matched. It is passed the instance of the error being handled,","file":"docs/errorhandling.rst","line":89,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 415: # if a request is in our blog URL space","file":"docs/errorhandling.rst","line":415,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 170: a request, such as templates, building URLs, or handling JSON data. See the rest of this","file":"docs/lifecycle.rst","line":170,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/logging.rst\nLine 129: record.url = request.url","file":"docs/logging.rst","line":129,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/logging.rst\nLine 138: '[%(asctime)s] %(remote_addr)s requested %(url)s\\n'","file":"docs/logging.rst","line":138,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 22: from flask import Flask, flash, request, redirect, url_for","file":"docs/patterns/fileuploads.rst","line":22,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 56: return redirect(request.url)","file":"docs/patterns/fileuploads.rst","line":56,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 62: return redirect(request.url)","file":"docs/patterns/fileuploads.rst","line":62,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 20: request, url_for","file":"docs/patterns/flashing.rst","line":20,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 66: request for it. First, you need to know the URL to request.","file":"docs/patterns/javascript.rst","line":66,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/urlprocessors.rst\nLine 60: after the request was matched and can execute code based on the URL","file":"docs/patterns/urlprocessors.rst","line":60,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 28: from flask import g, request, redirect, url_for","file":"docs/patterns/viewdecorators.rst","line":28,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 34: return redirect(url_for('login', next=request.url))","file":"docs/patterns/viewdecorators.rst","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 259: to try out :func:`~flask.url_for`. :meth:`~flask.Flask.test_request_context`","file":"docs/quickstart.rst","line":259,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 24: Blueprint, flash, g, redirect, render_template, request, url_for","file":"docs/tutorial/blog.rst","line":24,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 7: application. Flask uses patterns to match the incoming request URL to","file":"docs/tutorial/views.rst","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 33: Blueprint, flash, g, redirect, render_template, request, session, url_for","file":"docs/tutorial/views.rst","line":33,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/web-security.rst\nLine 118: Say you have a specific URL that, when you sent ``POST`` requests to will","file":"docs/web-security.rst","line":118,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/javascript/js_example/templates/xhr.html\nLine 16: request.open('POST', {{ url_for('add')|tojson }});","file":"examples/javascript/js_example/templates/xhr.html","line":16,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 510: def create_url_adapter(self, request: Request | None) -> MapAdapter | None:","file":"src/flask/app.py","line":510,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 511: \"\"\"Creates a URL adapter for the given request. The URL adapter","file":"src/flask/app.py","line":511,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 525: This can be called outside a request when the URL adapter is created","file":"src/flask/app.py","line":525,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 970: \"\"\"Does the request dispatching. Matches the URL and returns the","file":"src/flask/app.py","line":970,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1129: not in an active request, URLs will be external by default, but","file":"src/flask/app.py","line":1129,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1154: request, URLs are external by default.","file":"src/flask/app.py","line":1154,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1174: # When in a request, generate a URL without scheme and","file":"src/flask/app.py","line":1174,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Cómo se registra un nuevo tipo de etiqueta en el serializador?","query":"register tag serializer","file":"src/flask/json/tag.py","symbol":"register","line":256,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 923: - Allow registering new tags with ``TaggedJSONSerializer`` to support","file":"CHANGES.rst","line":923,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/tag.py\nLine 41: app.session_interface.serializer.register(TagOrderedDict, index=0)","file":"src/flask/json/tag.py","line":41,"lexical":0.65,"target":true},{"text":"File: src/flask/json/tag.py\nLine 262: \"\"\"Register a new tag with this serializer.","file":"src/flask/json/tag.py","line":262,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"obtener el objeto actual del contexto sin devolver la proxy","query":"get current object","file":"src/flask/globals.py","symbol":"_get_current_object","line":18,"lang":"es","candidates":[{"text":"File: docs/appcontext.rst\nLine 136: :meth:`~.LocalProxy._get_current_object` method in those cases.","file":"docs/appcontext.rst","line":136,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/appcontext.rst\nLine 140: app = current_app._get_current_object()","file":"docs/appcontext.rst","line":140,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/signals.rst\nLine 134: function, you can pass ``current_app._get_current_object()`` as sender.","file":"docs/signals.rst","line":134,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/signals.rst\nLine 139: ``current_app._get_current_object()`` instead. The reason for this is","file":"docs/signals.rst","line":139,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 101: args = (app_ctx._get_current_object(),)","file":"src/flask/app.py","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 103: args = (app_ctx._get_current_object(), *args)","file":"src/flask/app.py","line":103,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 631: if not current_app or current_app._get_current_object() is not app:","file":"src/flask/cli.py","line":631,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/globals.py\nLine 18: def _get_current_object(self) -> T: ...","file":"src/flask/globals.py","line":18,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/globals.py\nLine 21: # proxied type along with the _get_current_object method.","file":"src/flask/globals.py","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 351: app = current_app._get_current_object()","file":"src/flask/helpers.py","line":351,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 403: ctx = app_ctx._get_current_object()","file":"src/flask/helpers.py","line":403,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 25: ctx = app_ctx._get_current_object()","file":"src/flask/templating.py","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 146: ctx = app_ctx._get_current_object()","file":"src/flask/templating.py","line":146,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 158: ctx = app_ctx._get_current_object()","file":"src/flask/templating.py","line":158,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 195: ctx = app_ctx._get_current_object()","file":"src/flask/templating.py","line":195,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 210: ctx = app_ctx._get_current_object()","file":"src/flask/templating.py","line":210,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/conftest.py\nLine 76: leaks.append(_app_ctx._get_current_object())","file":"tests/conftest.py","line":76,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 36: assert flask.current_app._get_current_object() is app","file":"tests/test_appctx.py","line":36,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 42: assert flask.current_app._get_current_object() is app","file":"tests/test_appctx.py","line":42,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 298: same_app = current_app._get_current_object() is app","file":"tests/test_cli.py","line":298,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 64: assert wsgi_errors_stream._get_current_object() is sys.stderr","file":"tests/test_logging.py","line":64,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 67: assert wsgi_errors_stream._get_current_object() is stream","file":"tests/test_logging.py","line":67,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 200: req = flask.request._get_current_object()","file":"tests/test_testing.py","line":200,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 203: assert req is flask.request._get_current_object()","file":"tests/test_testing.py","line":203,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"テストで例外をキャッチするためのカスタム例外クラスがどこにあるか教えてください。","query":"custom exception class","file":"tests/test_user_error_handler.py","symbol":"CustomException","line":11,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 1263: - Removed custom JSON HTTP exception subclasses. If you were relying","file":"CHANGES.rst","line":1263,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 463: We can also create custom exception classes. For instance, we can","file":"docs/errorhandling.rst","line":463,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 11: class CustomException(Exception):","file":"tests/test_user_error_handler.py","line":11,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 22: assert \"CustomException() is an instance, not a class.\" in str(exc_info.value)","file":"tests/test_user_error_handler.py","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 220: class Custom(Exception):","file":"tests/test_user_error_handler.py","line":220,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"trouve la méthode pour simuler une requête avec un builder ou un dictionnaire","query":"test client request","file":"src/flask/testing.py","symbol":"open","line":204,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 928: - Add ``json`` keyword argument for the test client request methods.","file":"CHANGES.rst","line":928,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1177: in the test client when absolute URLs were requested.","file":"CHANGES.rst","line":1177,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1603: - Test client has not the ability to preserve the request context for","file":"CHANGES.rst","line":1603,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 83: Sending Requests with the Test Client","file":"docs/testing.rst","line":83,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 86: The test client makes requests to the application without running a live","file":"docs/testing.rst","line":86,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 106: def test_request_example(client):","file":"docs/testing.rst","line":106,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 295: takes the same arguments as the test client's request methods.","file":"docs/testing.rst","line":295,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 289: :meth:`client.get() ` makes a ``GET`` request","file":"docs/tutorial/tests.rst","line":289,"lexical":0.65,"target":false},{"text":"File: src/flask/ctx.py\nLine 276: ``request`` is still accessible. Similarly, the test client can preserve the","file":"src/flask/ctx.py","line":276,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 132: def test_request_dispatching(app, client):","file":"tests/test_basic.py","line":132,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 710: def test_request_processing(app, client):","file":"tests/test_basic.py","line":710,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 735: def test_request_preprocessing_early_return(app, client):","file":"tests/test_basic.py","line":735,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 762: def test_after_request_processing(app, client):","file":"tests/test_basic.py","line":762,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 777: def test_teardown_request_handler(app, client):","file":"tests/test_basic.py","line":777,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 795: def test_teardown_request_handler_debug_mode(app, client):","file":"tests/test_basic.py","line":795,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 813: def test_teardown_request_handler_error(app, client):","file":"tests/test_basic.py","line":813,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 851: def test_before_after_request_order(app, client):","file":"tests/test_basic.py","line":851,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 959: def test_before_request_and_routing_errors(app, client):","file":"tests/test_basic.py","line":959,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1058: def test_trap_bad_request_key_error(app, client, debug, trap, expect_key, expect_abort):","file":"tests/test_basic.py","line":1058,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1707: def test_no_setup_after_first_request(app, client):","file":"tests/test_basic.py","line":1707,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 765: def test_request_processing(app, client):","file":"tests/test_blueprints.py","line":765,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 796: def test_app_request_processing(app, client):","file":"tests/test_blueprints.py","line":796,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 15: def test_bad_request_debug_message(app, client, debug):","file":"tests/test_json.py","line":15,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 30: def test_json_bad_requests(app, client):","file":"tests/test_json.py","line":30,"lexical":0.65,"target":false},{"text":"File: tests/test_reqctx.py\nLine 148: request: pytest.FixtureRequest, app: flask.Flask, client: FlaskClient","file":"tests/test_reqctx.py","line":148,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 73: def test_client_open_environ(app, client, request):","file":"tests/test_testing.py","line":73,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 253: def test_full_url_request(app, client):","file":"tests/test_testing.py","line":253,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 265: def test_json_request_and_response(app, client):","file":"tests/test_testing.py","line":265,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Wie kann ich die Remote-Adresse des aktuellen Requests in Flask abrufen?","query":"flask request remote_addr","file":"tests/test_testing.py","symbol":"index","line":75,"lang":"de","candidates":[{"text":"File: tests/test_testing.py\nLine 45: flask.g.remote_addr = flask.request.remote_addr","file":"tests/test_testing.py","line":45,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_testing.py\nLine 60: flask.g.remote_addr = flask.request.remote_addr","file":"tests/test_testing.py","line":60,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 76: return flask.request.remote_addr","file":"tests/test_testing.py","line":76,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"cómo enviar peticiones con el cliente de pruebas","query":"test client requests","file":"docs/testing.rst","symbol":"Sending Requests with the Test Client","line":83,"lang":"es","candidates":[{"text":"File: docs/testing.rst\nLine 83: Sending Requests with the Test Client","file":"docs/testing.rst","line":83,"lexical":0.65,"target":true},{"text":"File: docs/testing.rst\nLine 86: The test client makes requests to the application without running a live","file":"docs/testing.rst","line":86,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 30: def test_json_bad_requests(app, client):","file":"tests/test_json.py","line":30,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"O teste está falhando ao verificar se o contexto da aplicação está disponível apenas quando existe um contexto de requisição ativo. O comportamento esperado é que o objeto da aplicação atual seja acessível dentro do bloco de requisição, mas não fora dele.","query":"request context app","file":"tests/test_appctx.py","symbol":"test_request_context_means_app_context","line":34,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 8: - ``RequestContext`` has merged with ``AppContext``. ``RequestContext`` is now","file":"CHANGES.rst","line":8,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 294: - The ``RequestContext.g`` property returning ``AppContext.g`` is","file":"CHANGES.rst","line":294,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 298: - The app and request contexts are managed using Python context vars","file":"CHANGES.rst","line":298,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 781: the app and request contexts, such as to query a database for an id.","file":"CHANGES.rst","line":781,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1241: - ``flask.g`` is now stored on the app context instead of the request","file":"CHANGES.rst","line":1241,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1330: - Added ``Flask.app_context`` which works very similar to the request","file":"CHANGES.rst","line":1330,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 39: This is only available when a :doc:`request context ` is","file":"docs/api.rst","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 70: This is only available when a :doc:`request context ` is","file":"docs/api.rst","line":70,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 169: Bound to the application context instead of the request context.","file":"docs/api.rst","line":169,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 304: This is only available when a :doc:`request context ` is","file":"docs/api.rst","line":304,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 367: any request processing happens. Because the request context is already","file":"docs/api.rst","line":367,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/appcontext.rst\nLine 1: The App and Request Context","file":"docs/appcontext.rst","line":1,"lexical":0.65,"target":false},{"text":"File: docs/appcontext.rst\nLine 107: with app.test_request_context(","file":"docs/appcontext.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/appcontext.rst\nLine 122: When a Flask application handles a request, it pushes a request context","file":"docs/appcontext.rst","line":122,"lexical":0.65,"target":false},{"text":"File: docs/extensiondev.rst\nLine 183: active during a request, CLI command, or ``with app.app_context()`` block. If","file":"docs/extensiondev.rst","line":183,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/extensiondev.rst\nLine 186: app context ends. If it should only be valid during a request, or would not be","file":"docs/extensiondev.rst","line":186,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 157: #. The app context is popped, :data:`.current_app`, :data:`.g`, :data:`.request`,","file":"docs/lifecycle.rst","line":157,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 161: When executing a CLI command or plain app context without request data, the same","file":"docs/lifecycle.rst","line":161,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 28: application context (which is always true if there is a request in flight)","file":"docs/patterns/sqlite3.rst","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 43: Please keep in mind that the teardown request and appcontext functions","file":"docs/patterns/sqlite3.rst","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/streaming.rst\nLine 72: :func:`.stream_with_context` wrapper. This will keep the request context active","file":"docs/patterns/streaming.rst","line":72,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 279: with app.test_request_context():","file":"docs/quickstart.rst","line":279,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 25: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 50: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 254: :func:`~flask.stream_with_context` wrapper if a request is active, so that","file":"docs/templating.rst","line":254,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 207: The app and request context will remain active *after* making a request,","file":"docs/testing.rst","line":207,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 279: active :doc:`app context ` because they access :data:`.request`,","file":"docs/testing.rst","line":279,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 294: Use ``with app.test_request_context()`` to push a request context. It","file":"docs/testing.rst","line":294,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 300: with app.test_request_context(","file":"docs/testing.rst","line":300,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 316: with app.test_request_context(\"/user/2/edit\", headers={\"X-Auth-Token\": \"1\"}):","file":"docs/testing.rst","line":316,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 969: def dispatch_request(self, ctx: AppContext) -> ft.ResponseReturnValue:","file":"src/flask/app.py","line":969,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 995: def full_dispatch_request(self, ctx: AppContext) -> Response:","file":"src/flask/app.py","line":995,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"I am debugging an issue where file uploads are not being found in the request form data. Please show me the custom exception class that provides a helpful error message when a file key is missing from the form.","query":"DebugFilesKeyError","file":"src/flask/debughelpers.py","symbol":"newcls","line":90,"lang":"en","candidates":[{"text":"File: src/flask/debughelpers.py\nLine 23: class DebugFilesKeyError(KeyError, AssertionError):","file":"src/flask/debughelpers.py","line":23,"lexical":0.35,"target":true},{"text":"File: src/flask/debughelpers.py\nLine 98: raise DebugFilesKeyError(request, key).with_traceback(","file":"src/flask/debughelpers.py","line":98,"lexical":0.35,"target":false},{"text":"File: tests/test_basic.py\nLine 1130: from flask.debughelpers import DebugFilesKeyError","file":"tests/test_basic.py","line":1130,"lexical":0.35,"target":false},{"text":"File: tests/test_basic.py\nLine 1138: with pytest.raises(DebugFilesKeyError) as e:","file":"tests/test_basic.py","line":1138,"lexical":0.35,"target":false}]} {"site":"project_search","repo":"flask","task":"exception이 전달될 때 cleanup_stuff에 추가하는 함수 찾아줘","query":"cleanup exception","file":"tests/test_appctx.py","symbol":"cleanup","line":121,"lang":"ko","candidates":[{"text":"File: tests/test_appctx.py\nLine 50: def cleanup(exception):","file":"tests/test_appctx.py","line":50,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_appctx.py\nLine 51: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":51,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 63: def cleanup(exception):","file":"tests/test_appctx.py","line":63,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 64: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":64,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 81: def cleanup(exception):","file":"tests/test_appctx.py","line":81,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 82: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":82,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 98: def cleanup(exception):","file":"tests/test_appctx.py","line":98,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 99: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":99,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 121: def cleanup(exception):","file":"tests/test_appctx.py","line":121,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 122: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":122,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Parece que la lógica de validación de métodos HTTP en las pruebas de las vistas está devolviendo un valor estático de texto en lugar de verificar el tipo de petición real.","query":"test view method","file":"tests/test_views.py","symbol":"get","line":30,"lang":"es","candidates":[{"text":"File: tests/test_async.py\nLine 81: @pytest.mark.parametrize(\"path\", [\"/\", \"/home\", \"/bp/\", \"/view\", \"/methodview\"])","file":"tests/test_async.py","line":81,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 28: def test_method_based_view(app):","file":"tests/test_views.py","line":28,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"necesito obtener una instancia del cliente de prueba para la aplicación en los fixtures de pytest","query":"app test client fixture","file":"tests/conftest.py","symbol":"client","line":50,"lang":"es","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 122: object created by the ``app`` fixture. Tests will use the client to make","file":"docs/tutorial/tests.rst","line":122,"lexical":0.65,"target":false},{"text":"File: tests/test_reqctx.py\nLine 148: request: pytest.FixtureRequest, app: flask.Flask, client: FlaskClient","file":"tests/test_reqctx.py","line":148,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"查找将异步函数包装为同步以适配 wsgi 运行环境的方法","query":"async to sync","file":"src/flask/app.py","symbol":"ensure_sync","line":1068,"lang":"zh","candidates":[{"text":"File: docs/async-await.rst\nLine 10: ``async`` extra (``pip install flask[async]``). This allows views to be","file":"docs/async-await.rst","line":10,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 30: Async functions require an event loop to run. Flask, as a WSGI","file":"docs/async-await.rst","line":30,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 32: When a request comes in to an async view, Flask will start an event loop","file":"docs/async-await.rst","line":32,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 36: is that you can run async code within a view, for example to make","file":"docs/async-await.rst","line":36,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 69: to the way it is implemented. If you have a mainly async codebase it","file":"docs/async-await.rst","line":69,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 77: Python functions to accomplish this, whereas ``async``/``await`` and ASGI use","file":"docs/async-await.rst","line":77,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 111: implemented async support, or make a feature request or PR to them.","file":"docs/async-await.rst","line":111,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 117: At the moment Flask only supports :mod:`asyncio`. It's possible to override","file":"docs/async-await.rst","line":117,"lexical":0.65,"target":false},{"text":"File: docs/async-await.rst\nLine 118: :meth:`flask.Flask.ensure_sync` to change how async functions are wrapped to use","file":"docs/async-await.rst","line":118,"lexical":0.65,"target":false},{"text":"File: docs/design.rst\nLine 195: before ``async`` was introduced into Python. This compromise introduces","file":"docs/design.rst","line":195,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 4: `Gevent`_ patches Python's standard library to run within special async workers","file":"docs/gevent.rst","line":4,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 12: and to achieve similar capabilities to ASGI and asyncio. This works without","file":"docs/gevent.rst","line":12,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 13: needing to write ``async def`` or ``await`` anywhere, but relies on gevent and","file":"docs/gevent.rst","line":13,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 68: If you want to use Gevent and asyncio in the same app, you'll need to override","file":"docs/gevent.rst","line":68,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 69: :meth:`flask.Flask.async_to_sync` to run async functions inside gevent.","file":"docs/gevent.rst","line":69,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 83: def async_to_sync(self, func):","file":"docs/gevent.rst","line":83,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 107: also a project called `uvloop`_ that enables libuv in asyncio. If you want to","file":"docs/gevent.rst","line":107,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 109: modify the ``async_to_sync`` code from the previous section to work with uvloop,","file":"docs/gevent.rst","line":109,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1073: Override this method to change how the app runs async views.","file":"src/flask/app.py","line":1073,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 1078: return self.async_to_sync(func)","file":"src/flask/app.py","line":1078,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1082: def async_to_sync(","file":"src/flask/app.py","line":1082,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1089: result = app.async_to_sync(func)(*args, **kwargs)","file":"src/flask/app.py","line":1089,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1091: Override this method to change how the app converts async code","file":"src/flask/app.py","line":1091,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1097: from asgiref.sync import async_to_sync as asgiref_async_to_sync","file":"src/flask/app.py","line":1097,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1100: \"Install Flask with the 'async' extra in order to use async views.\"","file":"src/flask/app.py","line":1100,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1103: return asgiref_async_to_sync(func)","file":"src/flask/app.py","line":1103,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"帮我找一下测试代码里那个用来打印当前应用名称的函数。","query":"click echo current_app","file":"tests/test_cli.py","symbol":"show","line":390,"lang":"zh","candidates":[{"text":"File: tests/test_cli.py\nLine 310: click.echo(current_app.name)","file":"tests/test_cli.py","line":310,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_cli.py\nLine 326: click.echo(current_app.name)","file":"tests/test_cli.py","line":326,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 334: click.echo(current_app.name)","file":"tests/test_cli.py","line":334,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 357: click.echo(current_app.name)","file":"tests/test_cli.py","line":357,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 377: click.echo(str(current_app.debug))","file":"tests/test_cli.py","line":377,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 391: click.echo(current_app.name)","file":"tests/test_cli.py","line":391,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"セッションに関連する例外処理をテストしたいので、エラーを定義している箇所を教えてください。カスタム例外のクラスが見つかりません。","query":"Session Exception","file":"tests/test_reqctx.py","symbol":"SessionError","line":178,"lang":"ja","candidates":[{"text":"File: docs/patterns/sqlalchemy.rst\nLine 67: def shutdown_session(exception=None):","file":"docs/patterns/sqlalchemy.rst","line":67,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 140: def shutdown_session(exception=None):","file":"docs/patterns/sqlalchemy.rst","line":140,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 392: expect_exception(flask.session.__setitem__, \"foo\", 42)","file":"tests/test_basic.py","line":392,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 393: expect_exception(flask.session.pop, \"foo\")","file":"tests/test_basic.py","line":393,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_reqctx.py\nLine 178: class SessionError(Exception):","file":"tests/test_reqctx.py","line":178,"lexical":0.39999999999999997,"target":true}]} {"site":"project_search","repo":"flask","task":"print app name","query":"app name echo","file":"tests/test_cli.py","symbol":"test","line":325,"lang":"de","candidates":[{"text":"File: tests/test_cli.py\nLine 310: click.echo(current_app.name)","file":"tests/test_cli.py","line":310,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_cli.py\nLine 326: click.echo(current_app.name)","file":"tests/test_cli.py","line":326,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 334: click.echo(current_app.name)","file":"tests/test_cli.py","line":334,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 357: click.echo(current_app.name)","file":"tests/test_cli.py","line":357,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 391: click.echo(current_app.name)","file":"tests/test_cli.py","line":391,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Estou tentando entender como a aplicação é instanciada nos testes para configurar o ambiente de integração. Onde está a lógica que define tanto a instância global quanto o método de fábrica para o framework web?","query":"Flask create_app","file":"tests/test_cli.py","symbol":"Module","line":90,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 902: needed, for example ``FLASK_APP=myproject.app:create_app('dev')``.","file":"CHANGES.rst","line":902,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/cli.rst\nLine 492: @click.group(cls=FlaskGroup, create_app=create_app)","file":"docs/cli.rst","line":492,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 102: $ flask --app 'hello:create_app(local_auth=True)' run","file":"docs/patterns/appfactories.rst","line":102,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 107: def create_app() -> Flask:","file":"docs/patterns/celery.rst","line":107,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 128: flask_app = create_app()","file":"docs/patterns/celery.rst","line":128,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 100: $ waitress-serve --call 'flaskr:create_app'","file":"docs/tutorial/deploy.rst","line":100,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 74: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":74,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 150: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":150,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/celery/make_celery.py\nLine 3: flask_app = create_app()","file":"examples/celery/make_celery.py","line":3,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/celery/src/task_app/__init__.py\nLine 7: def create_app() -> Flask:","file":"examples/celery/src/task_app/__init__.py","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 6: from flaskr import create_app","file":"examples/tutorial/tests/conftest.py","line":6,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/tests/test_factory.py\nLine 1: from flaskr import create_app","file":"examples/tutorial/tests/test_factory.py","line":1,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/cli.py\nLine 308: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":308,"lexical":0.5,"target":false},{"text":"File: src/flask/cli.py\nLine 566: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":566,"lexical":0.5,"target":false},{"text":"File: tests/test_cli.py\nLine 301: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":301,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_cli.py\nLine 312: obj = ScriptInfo(create_app=lambda: Flask(\"testapp\"))","file":"tests/test_cli.py","line":312,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 336: obj = ScriptInfo(create_app=lambda: Flask(\"testappgroup\"))","file":"tests/test_cli.py","line":336,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 351: @click.group(cls=FlaskGroup, create_app=create_app)","file":"tests/test_cli.py","line":351,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 371: @click.group(cls=FlaskGroup, create_app=create_app, set_debug_flag=set_debug_flag)","file":"tests/test_cli.py","line":371,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 386: flask_group = FlaskGroup(name=\"flask\", create_app=lambda: app)","file":"tests/test_cli.py","line":386,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 431: cli = FlaskGroup(create_app=create_app)","file":"tests/test_cli.py","line":431,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 459: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":459,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 497: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":497,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 506: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":506,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 515: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":515,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Wie wird der Dekorator für die Testung von Templates implementiert?","query":"template test decorator","file":"src/flask/sansio/app.py","symbol":"template_test","line":716,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 180: For template tests, use the :meth:`~.Flask.template_test` decorator or","file":"docs/templating.rst","line":180,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 749: def decorator(f: T_template_test) -> T_template_test:","file":"src/flask/sansio/app.py","line":749,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 761: The :meth:`template_test` decorator can be used to register a function","file":"src/flask/sansio/app.py","line":761,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 525: def decorator(f: T_template_test) -> T_template_test:","file":"src/flask/sansio/blueprints.py","line":525,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 537: The :meth:`app_template_test` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":537,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"测试在应用上下文销毁时,如果之前没有发生异常,清理回调函数接收到的异常参数是否为 None。","query":"teardown exception None","file":"tests/test_appctx.py","symbol":"test_app_tearing_down_with_previous_exception","line":59,"lang":"zh","candidates":[{"text":"File: tests/test_appctx.py\nLine 220: def request_teardown(e: Exception | None) -> None:","file":"tests/test_appctx.py","line":220,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_appctx.py\nLine 226: def app_teardown(e: Exception | None) -> None:","file":"tests/test_appctx.py","line":226,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_app_decorators.py\nLine 28: def teardown_sync(exc: BaseException | None) -> None: ...","file":"tests/type_check/typing_app_decorators.py","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_app_decorators.py\nLine 32: async def teardown_async(exc: BaseException | None) -> None: ...","file":"tests/type_check/typing_app_decorators.py","line":32,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Jinja 템플릿에서 사용할 수 있는 사용자 정의 테스트 함수를 등록하는 방법을 알려줘. 데코레이터 말고 직접 함수를 전달해서 등록하는 코드가 어디에 있어?","query":"register jinja test","file":"src/flask/sansio/app.py","symbol":"add_template_test","line":756,"lang":"ko","candidates":[{"text":"File: src/flask/sansio/app.py\nLine 723: \"\"\"Decorate a function to register it as a custom Jinja test. The name","file":"src/flask/sansio/app.py","line":723,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 759: \"\"\"Register a function to use as a custom Jinja test.","file":"src/flask/sansio/app.py","line":759,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 507: \"\"\"Decorate a function to register it as a custom Jinja test. The name","file":"src/flask/sansio/blueprints.py","line":507,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 535: \"\"\"Register a function to use as a custom Jinja test.","file":"src/flask/sansio/blueprints.py","line":535,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Wo wird die Funktion definiert, die einfach nur die übergebene Firmen-ID zurückgibt?","query":"return company_id","file":"tests/test_testing.py","symbol":"view","line":310,"lang":"de","candidates":[{"text":"File: tests/test_testing.py\nLine 311: return company_id","file":"tests/test_testing.py","line":311,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_testing.py\nLine 328: return company_id","file":"tests/test_testing.py","line":328,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm trying to verify how the application handles session data during the initial request cycle. Can you show me where the logic is that retrieves a specific key from the user's session and provides a default string if it's missing?","query":"flask session get","file":"tests/test_basic.py","symbol":"do_get","line":244,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1228: ``flask.sessions`` instead to get the session module. This is not to","file":"CHANGES.rst","line":1228,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sessions.py\nLine 223: def get_expiration_time(self, app: Flask, session: SessionMixin) -> datetime | None:","file":"src/flask/sessions.py","line":223,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 245: return flask.session.get(\"value\", \"None\")","file":"tests/test_basic.py","line":245,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_basic.py\nLine 391: assert flask.session.get(\"missing_key\") is None","file":"tests/test_basic.py","line":391,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 464: return repr(flask.session.get(\"foo\"))","file":"tests/test_basic.py","line":464,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 506: rv = flask.session[\"foo\"] = flask.session.get(\"foo\", 0) + 1","file":"tests/test_basic.py","line":506,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 512: return str(flask.session.get(\"foo\", 0))","file":"tests/test_basic.py","line":512,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 550: return flask.session.get(\"test\")","file":"tests/test_basic.py","line":550,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 224: v = flask.session.get(\"value\", \"None\")","file":"tests/test_reqctx.py","line":224,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 234: v = flask.session.get(\"value\", \"None\")","file":"tests/test_reqctx.py","line":234,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 148: flask.session[\"target\"] = True","file":"tests/test_testing.py","line":148,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 154: assert flask.session[\"target\"] is True","file":"tests/test_testing.py","line":154,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 180: return str(flask.session.get(\"value\"))","file":"tests/test_testing.py","line":180,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"コマンドライン引数で指定したアプリケーション名が、期待通りの名称で正しく特定できるか確認するテストが失敗する可能性があります。実行結果の名称比較ロジックが正しいか調査してください。","query":"locate app test","file":"tests/test_cli.py","symbol":"test_locate_app","line":194,"lang":"ja","candidates":[{"text":"File: tests/test_cli.py\nLine 194: def test_locate_app(test_apps, iname, aname, result):","file":"tests/test_cli.py","line":194,"lexical":0.65,"target":true},{"text":"File: tests/test_cli.py\nLine 216: def test_locate_app_raises(test_apps, iname, aname):","file":"tests/test_cli.py","line":216,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 221: def test_locate_app_suppress_raise(test_apps):","file":"tests/test_cli.py","line":221,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"procura a definição de variável de ambiente para o teste da aplicação flask","query":"flaskenv variable","file":"tests/test_apps/.flaskenv","symbol":"FOO","line":1,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 962: variables from ``.env`` and ``.flaskenv`` files if python-dotenv is","file":"CHANGES.rst","line":962,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/cli.rst\nLine 164: environment variables defined in the files ``.env`` and ``.flaskenv``.","file":"docs/cli.rst","line":164,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 686: variables from :file:`.env` and :file:`.flaskenv` files.","file":"src/flask/app.py","line":686,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/cli.py\nLine 522: \" those set by '.env' and '.flaskenv'. Variables set directly in the\"","file":"src/flask/cli.py","line":522,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"在蓝图上注册一个全局jinja模板过滤器","query":"app template filter","file":"src/flask/sansio/blueprints.py","symbol":"app_template_filter","line":450,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 1313: application wide, ``Blueprint.app_template_filter``.","file":"CHANGES.rst","line":1313,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1315: adding custom template filters application wide,","file":"CHANGES.rst","line":1315,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1317: ``Blueprint.add_app_template_filter``.","file":"CHANGES.rst","line":1317,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 152: @app.template_filter","file":"docs/templating.rst","line":152,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 166: @app.template_filter(\"reverse\")","file":"docs/templating.rst","line":166,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 178: app.add_template_filter(reverse_filter, \"reverse\")","file":"docs/templating.rst","line":178,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 678: @app.template_filter(\"reverse\")","file":"src/flask/sansio/app.py","line":678,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 444: def app_template_filter(self, name: T_template_filter) -> T_template_filter: ...","file":"src/flask/sansio/blueprints.py","line":444,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 446: def app_template_filter(","file":"src/flask/sansio/blueprints.py","line":446,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 450: def app_template_filter(","file":"src/flask/sansio/blueprints.py","line":450,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 456: The :meth:`add_app_template_filter` method may be used to register a","file":"src/flask/sansio/blueprints.py","line":456,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 466: self.add_app_template_filter(name)","file":"src/flask/sansio/blueprints.py","line":466,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 470: self.add_app_template_filter(f, name=name)","file":"src/flask/sansio/blueprints.py","line":470,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 476: def add_app_template_filter(","file":"src/flask/sansio/blueprints.py","line":476,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 481: The :meth:`app_template_filter` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":481,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 493: state.app.add_template_filter(f, name=name)","file":"src/flask/sansio/blueprints.py","line":493,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 350: def test_template_filter(app):","file":"tests/test_blueprints.py","line":350,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 353: @bp.app_template_filter()","file":"tests/test_blueprints.py","line":353,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 357: @bp.app_template_filter","file":"tests/test_blueprints.py","line":357,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 361: @bp.app_template_filter(\"my_reverse_custom_name_3\")","file":"tests/test_blueprints.py","line":361,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 365: @bp.app_template_filter(name=\"my_reverse_custom_name_4\")","file":"tests/test_blueprints.py","line":365,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 387: def test_add_template_filter(app):","file":"tests/test_blueprints.py","line":387,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 393: bp.add_app_template_filter(my_reverse)","file":"tests/test_blueprints.py","line":393,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 400: def test_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":400,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 403: @bp.app_template_filter(\"strrev\")","file":"tests/test_blueprints.py","line":403,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 413: def test_add_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":413,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 419: bp.add_app_template_filter(my_reverse, \"strrev\")","file":"tests/test_blueprints.py","line":419,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 426: def test_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":426,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 429: @bp.app_template_filter()","file":"tests/test_blueprints.py","line":429,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 443: def test_template_filter_after_route_with_template(app, client):","file":"tests/test_blueprints.py","line":443,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 450: @bp.app_template_filter()","file":"tests/test_blueprints.py","line":450,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 459: def test_add_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":459,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"montre comment définir une nouvelle structure de composant","query":"create blueprint","file":"docs/tutorial/views.rst","symbol":"Create a Blueprint","line":13,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 223: - If a blueprint is created with an empty name it raises a ``ValueError``.","file":"CHANGES.rst","line":223,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 552: - Combine URL prefixes when nesting blueprints that were created with","file":"CHANGES.rst","line":552,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 642: 1. Create your application in a function and register blueprints on it.","file":"docs/config.rst","line":642,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 13: Create a Blueprint","file":"docs/tutorial/views.rst","line":13,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/tutorial/views.rst\nLine 41: This creates a :class:`Blueprint` named ``'auth'``. Like the application","file":"docs/tutorial/views.rst","line":41,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 51: #: a reference to the blueprint that created this setup state.","file":"src/flask/sansio/blueprints.py","line":51,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 129: Decorating a function with a blueprint creates a deferred function","file":"src/flask/sansio/blueprints.py","line":129,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 249: \"\"\"Creates an instance of :meth:`~flask.blueprints.BlueprintSetupState`","file":"src/flask/sansio/blueprints.py","line":249,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 276: application. Creates a :class:`.BlueprintSetupState` and calls","file":"src/flask/sansio/blueprints.py","line":276,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"Wo kann ich die maximale Größe der eingehenden Anfragen einschränken?","query":"set max content","file":"src/flask/wrappers.py","symbol":"max_content_length","line":89,"lang":"de","candidates":[{"text":"File: docs/patterns/fileuploads.rst\nLine 138: memory, but you can limit that by setting the ``MAX_CONTENT_LENGTH``","file":"docs/patterns/fileuploads.rst","line":138,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/wrappers.py\nLine 88: @max_content_length.setter","file":"src/flask/wrappers.py","line":88,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"Estou escrevendo novos casos de teste para o sistema de templates e preciso de uma forma de validar se um valor é estritamente um booleano. Você pode me mostrar onde está a função que faz essa verificação de tipo?","query":"isinstance bool","file":"tests/test_templating.py","symbol":"boolean","line":276,"lang":"pt","candidates":[{"text":"File: src/flask/debughelpers.py\nLine 119: elif not isinstance(value, (str, int, float, bool)):","file":"src/flask/debughelpers.py","line":119,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 515: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":515,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 519: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":519,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 523: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":523,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 527: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":527,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 551: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":551,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 565: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":565,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 577: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":577,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 591: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":591,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 612: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":612,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 623: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":623,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 641: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":641,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 657: return isinstance(value, bool)","file":"tests/test_blueprints.py","line":657,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 244: return isinstance(value, bool)","file":"tests/test_templating.py","line":244,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_templating.py\nLine 252: return isinstance(value, bool)","file":"tests/test_templating.py","line":252,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 260: return isinstance(value, bool)","file":"tests/test_templating.py","line":260,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 268: return isinstance(value, bool)","file":"tests/test_templating.py","line":268,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 277: return isinstance(value, bool)","file":"tests/test_templating.py","line":277,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 288: return isinstance(value, bool)","file":"tests/test_templating.py","line":288,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 297: return isinstance(value, bool)","file":"tests/test_templating.py","line":297,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 308: return isinstance(value, bool)","file":"tests/test_templating.py","line":308,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 320: return isinstance(value, bool)","file":"tests/test_templating.py","line":320,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 335: return isinstance(value, bool)","file":"tests/test_templating.py","line":335,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 347: return isinstance(value, bool)","file":"tests/test_templating.py","line":347,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Il est impossible d'ajouter des en-têtes personnalisés aux réponses générées automatiquement par le framework car l'objet de réponse n'est pas accessible avant la fin de la fonction de vue. J'ai besoin d'un moyen de convertir explicitement le contenu retourné en un objet de réponse manipulable pour y injecter des métadonnées HTTP.","query":"convert return response","file":"src/flask/helpers.py","symbol":"make_response","line":151,"lang":"fr","candidates":[{"text":"File: docs/quickstart.rst\nLine 641: response. The logic that Flask applies to converting return values into","file":"docs/quickstart.rst","line":641,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 972: be a response object. In order to convert the return value to a","file":"src/flask/app.py","line":972,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"사용자 정의 오류 처리 로직이 제대로 작동하는지 확인하려고 해요. 특정 상황에서 리소스를 찾을 수 없을 때 발생하는 예외가 테스트에서 잘 던져지는지 보여주는 코드가 어디에 있나요?","query":"raise NotFound test","file":"tests/test_user_error_handler.py","symbol":"bp_registered_test","line":178,"lang":"ko","candidates":[{"text":"File: tests/test_basic.py\nLine 1096: with pytest.raises(NotFound):","file":"tests/test_basic.py","line":1096,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 213: with pytest.raises(TemplateNotFound) as e:","file":"tests/test_blueprints.py","line":213,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 516: with pytest.raises(TemplateNotFound) as excinfo:","file":"tests/test_templating.py","line":516,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"測試中,當傳入名為字串的參數時,渲染 index.html 模板的邏輯似乎可以更簡化或被封裝,目前它是透過一個輔助函式來處理帶有選填名稱的索引頁渲染。","query":"render index template","file":"tests/type_check/typing_route.py","symbol":"return_template","line":87,"lang":"zh","candidates":[{"text":"File: docs/blueprints.rst\nLine 240: want to render the template ``'admin/index.html'`` and you have provided","file":"docs/blueprints.rst","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 248: want to render a template called :file:`index.html` which is specific to this","file":"docs/blueprints.rst","line":248,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 259: And then when you want to render the template, use :file:`admin/index.html` as","file":"docs/blueprints.rst","line":259,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 51: return render_template(current_app.config['INDEX_TEMPLATE'])","file":"docs/patterns/appfactories.rst","line":51,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 27: return render_template('index.html')","file":"docs/patterns/flashing.rst","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 114: return render_template('index.html', value=42)","file":"docs/patterns/viewdecorators.rst","line":114,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 87: return render_template('blog/index.html', posts=posts)","file":"docs/tutorial/blog.rst","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/src/task_app/__init__.py\nLine 21: return render_template(\"index.html\")","file":"examples/celery/src/task_app/__init__.py","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/blog.py\nLine 25: return render_template(\"blog/index.html\", posts=posts)","file":"examples/tutorial/flaskr/blog.py","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 161: return render_template('index.html', foo=42)","file":"src/flask/helpers.py","line":161,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 166: response = make_response(render_template('index.html', foo=42))","file":"src/flask/helpers.py","line":166,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/blueprintapp/apps/admin/__init__.py\nLine 15: return render_template(\"admin/index.html\")","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","line":15,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/blueprintapp/apps/admin/__init__.py\nLine 20: return render_template(\"./admin/index.html\")","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/blueprintapp/apps/frontend/__init__.py\nLine 9: return render_template(\"frontend/index.html\")","file":"tests/test_apps/blueprintapp/apps/frontend/__init__.py","line":9,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 416: return flask.render_template(\"index.html\")","file":"tests/test_templating.py","line":416,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 88: return render_template(\"index.html\", name=name)","file":"tests/type_check/typing_route.py","line":88,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"¿Cómo se estructuran los objetos que se devuelven en las respuestas?","query":"response objects","file":"docs/api.rst","symbol":"Response Objects","line":45,"lang":"es","candidates":[{"text":"File: docs/api.rst\nLine 45: Response Objects","file":"docs/api.rst","line":45,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/patterns/deferredcallbacks.rst\nLine 4: One of the design principles of Flask is that response objects are created and","file":"docs/patterns/deferredcallbacks.rst","line":4,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 556: :attr:`~flask.Response.set_cookie` method of response objects. The","file":"docs/quickstart.rst","line":556,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 582: Note that cookies are set on response objects. Since you normally","file":"docs/quickstart.rst","line":582,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 584: response objects for you. If you explicitly want to do that you can use","file":"docs/quickstart.rst","line":584,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 642: response objects is as follows:","file":"docs/quickstart.rst","line":642,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 245: #: The class that is used for response objects. See","file":"src/flask/app.py","line":245,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 153: views do not have to return response objects but can return a value that","file":"src/flask/helpers.py","line":153,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"我想看看测试里有没有获取当前路由终点信息的辅助函数。我正在写关于蓝图路由测试的用例。","query":"flask request endpoint","file":"tests/test_blueprints.py","symbol":"foobar","line":341,"lang":"zh","candidates":[{"text":"File: tests/test_basic.py\nLine 1747: return flask.request.endpoint","file":"tests/test_basic.py","line":1747,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1751: return flask.request.endpoint","file":"tests/test_basic.py","line":1751,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1755: return flask.request.endpoint","file":"tests/test_basic.py","line":1755,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 288: return flask.request.endpoint","file":"tests/test_blueprints.py","line":288,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 292: return flask.request.endpoint","file":"tests/test_blueprints.py","line":292,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 296: return flask.request.endpoint","file":"tests/test_blueprints.py","line":296,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 300: return flask.request.endpoint","file":"tests/test_blueprints.py","line":300,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 306: return flask.request.endpoint","file":"tests/test_blueprints.py","line":306,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 342: return flask.request.endpoint","file":"tests/test_blueprints.py","line":342,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1092: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1092,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1104: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1104,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"trouve la logique qui détermine la durée de mise en cache des fichiers envoyés","query":"send_file max_age","file":"src/flask/blueprints.py","symbol":"get_send_file_max_age","line":55,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 195: - The ``session_cookie_name``, ``send_file_max_age_default``, ``use_x_sendfile``,","file":"CHANGES.rst","line":195,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 312: ``session_cookie_name``, ``send_file_max_age_default``,","file":"CHANGES.rst","line":312,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 548: ``get_send_file_max_age``. :issue:`4044`, :pr:`4026`","file":"CHANGES.rst","line":548,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 632: - ``send_file`` sets ``conditional=True`` and ``max_age=None`` by","file":"CHANGES.rst","line":632,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1337: - ``Flask`` and ``Blueprint`` now provide a ``get_send_file_max_age``","file":"CHANGES.rst","line":1337,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1344: ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is used","file":"CHANGES.rst","line":1344,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1345: in the default ``get_send_file_max_age`` implementation.","file":"CHANGES.rst","line":1345,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 250: .. py:data:: SEND_FILE_MAX_AGE_DEFAULT","file":"docs/config.rst","line":250,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 255: :meth:`~flask.Flask.get_send_file_max_age` on the application or","file":"docs/config.rst","line":255,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 230: \"SEND_FILE_MAX_AGE_DEFAULT\": None,","file":"src/flask/app.py","line":230,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 366: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/app.py","line":366,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 367: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/app.py","line":367,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 370: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/app.py","line":370,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 383: value = self.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/app.py","line":383,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 408: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/app.py","line":408,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 410: max_age = self.get_send_file_max_age(filename)","file":"src/flask/app.py","line":410,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 55: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/blueprints.py","line":55,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/blueprints.py\nLine 56: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/blueprints.py","line":56,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 59: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/blueprints.py","line":59,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 72: value = current_app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/blueprints.py","line":72,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 97: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/blueprints.py","line":97,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 99: max_age = self.get_send_file_max_age(filename)","file":"src/flask/blueprints.py","line":99,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 406: kwargs[\"max_age\"] = ctx.app.get_send_file_max_age","file":"src/flask/helpers.py","line":406,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 515: :meth:`Flask.get_send_file_max_age`.","file":"src/flask/helpers.py","line":515,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 194: max_age_default = app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"tests/test_blueprints.py","line":194,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 197: if app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] == expected_max_age:","file":"tests/test_blueprints.py","line":197,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 199: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = expected_max_age","file":"tests/test_blueprints.py","line":199,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 204: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = max_age_default","file":"tests/test_blueprints.py","line":204,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 223: def get_send_file_max_age(self, filename):","file":"tests/test_blueprints.py","line":223,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 55: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = 3600","file":"tests/test_helpers.py","line":55,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 70: def get_send_file_max_age(self, filename):","file":"tests/test_helpers.py","line":70,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Wie wird geprüft, ob das Rendering von Variablen aus dem Konfigurationsobjekt in einem Template korrekt funktioniert?","query":"render template config","file":"tests/test_templating.py","symbol":"test_original_win","line":24,"lang":"de","candidates":[{"text":"File: docs/patterns/appfactories.rst\nLine 51: return render_template(current_app.config['INDEX_TEMPLATE'])","file":"docs/patterns/appfactories.rst","line":51,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 27: return flask.render_template_string(\"{{ config }}\", config=42)","file":"tests/test_templating.py","line":27,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_templating.py\nLine 49: rv = flask.render_template_string(\"Hello {{ config.WORLD_NAME }} {{ foo }}\")","file":"tests/test_templating.py","line":49,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"How do I register a function to inject variables into Flask templates?","query":"template context processor","file":"src/flask/sansio/scaffold.py","symbol":"context_processor","line":550,"lang":"en","candidates":[{"text":"File: docs/templating.rst\nLine 199: template context. A context processor is a function that returns a","file":"docs/templating.rst","line":199,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 596: context as well as everything template context processors want","file":"src/flask/app.py","line":596,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 615: if name in self.template_context_processors:","file":"src/flask/app.py","line":615,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 616: for func in self.template_context_processors[name]:","file":"src/flask/app.py","line":616,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 22: T_template_context_processor = t.TypeVar(","file":"src/flask/sansio/blueprints.py","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 23: \"T_template_context_processor\", bound=ft.TemplateContextProcessorCallable","file":"src/flask/sansio/blueprints.py","line":23,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 410: extend(self.template_context_processors, app.template_context_processors)","file":"src/flask/sansio/blueprints.py","line":410,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 645: self, f: T_template_context_processor","file":"src/flask/sansio/blueprints.py","line":645,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 646: ) -> T_template_context_processor:","file":"src/flask/sansio/blueprints.py","line":646,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 647: \"\"\"Like :meth:`context_processor`, but for templates rendered by every view, not","file":"src/flask/sansio/blueprints.py","line":647,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 651: lambda s: s.app.template_context_processors.setdefault(None, []).append(f)","file":"src/flask/sansio/blueprints.py","line":651,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 32: T_template_context_processor = t.TypeVar(","file":"src/flask/sansio/scaffold.py","line":32,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/scaffold.py\nLine 33: \"T_template_context_processor\", bound=ft.TemplateContextProcessorCallable","file":"src/flask/sansio/scaffold.py","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 182: self.template_context_processors: dict[","file":"src/flask/sansio/scaffold.py","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 183: ft.AppOrBlueprintKey, list[ft.TemplateContextProcessorCallable]","file":"src/flask/sansio/scaffold.py","line":183,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 552: f: T_template_context_processor,","file":"src/flask/sansio/scaffold.py","line":552,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 553: ) -> T_template_context_processor:","file":"src/flask/sansio/scaffold.py","line":553,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 554: \"\"\"Registers a template context processor function. These functions run before","file":"src/flask/sansio/scaffold.py","line":554,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 561: and affect every template, use :meth:`.Blueprint.app_context_processor`.","file":"src/flask/sansio/scaffold.py","line":561,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 563: self.template_context_processors[None].append(f)","file":"src/flask/sansio/scaffold.py","line":563,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 22: \"\"\"Default template context processor. Replaces the ``request`` and ``g``","file":"src/flask/templating.py","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/typing.py\nLine 64: TemplateContextProcessorCallable = (","file":"src/flask/typing.py","line":64,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Investigate why the command-line interface execution environment for automated tests is failing to capture or report results correctly when triggered via the documentation-defined testing utility.","query":"test cli runner","file":"docs/api.rst","symbol":"Test CLI Runner","line":133,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 983: - Added ``Flask.test_cli_runner`` to create a Click runner that can","file":"CHANGES.rst","line":983,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 133: Test CLI Runner","file":"docs/api.rst","line":133,"lexical":0.44999999999999996,"target":true},{"text":"File: docs/testing.rst\nLine 41: test client, and CLI runner are shown below, they can be placed in","file":"docs/testing.rst","line":41,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 80: return app.test_cli_runner()","file":"docs/testing.rst","line":80,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 248: Flask provides :meth:`~flask.Flask.test_cli_runner` to create a","file":"docs/testing.rst","line":248,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 249: :class:`~flask.testing.FlaskCliRunner`, which runs CLI commands in","file":"docs/testing.rst","line":249,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 251: object. Flask's runner extends :doc:`Click's runner `,","file":"docs/testing.rst","line":251,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 254: Use the runner's :meth:`~flask.testing.FlaskCliRunner.invoke` method to","file":"docs/testing.rst","line":254,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 107: return app.test_cli_runner()","file":"docs/tutorial/tests.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 43: \"\"\"A test runner for the app's Click commands.\"\"\"","file":"examples/tutorial/tests/conftest.py","line":43,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 44: return app.test_cli_runner()","file":"examples/tutorial/tests/conftest.py","line":44,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 62: from .testing import FlaskCliRunner","file":"src/flask/app.py","line":62,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 816: def test_cli_runner(self, **kwargs: t.Any) -> FlaskCliRunner:","file":"src/flask/app.py","line":816,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 817: \"\"\"Create a CLI runner for testing CLI commands.","file":"src/flask/app.py","line":817,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 820: Returns an instance of :attr:`test_cli_runner_class`, by default","file":"src/flask/app.py","line":820,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 821: :class:`~flask.testing.FlaskCliRunner`. The Flask app object is","file":"src/flask/app.py","line":821,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 826: cls = self.test_cli_runner_class","file":"src/flask/app.py","line":826,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 829: from .testing import FlaskCliRunner as cls","file":"src/flask/app.py","line":829,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 40: from ..testing import FlaskCliRunner","file":"src/flask/sansio/app.py","line":40,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 268: #: The :class:`~click.testing.CliRunner` subclass, by default","file":"src/flask/sansio/app.py","line":268,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 269: #: :class:`~flask.testing.FlaskCliRunner` that is used by","file":"src/flask/sansio/app.py","line":269,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 270: #: :meth:`test_cli_runner`. Its ``__init__`` method should take a","file":"src/flask/sansio/app.py","line":270,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 274: test_cli_runner_class: type[FlaskCliRunner] | None = None","file":"src/flask/sansio/app.py","line":274,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 12: from click.testing import CliRunner","file":"src/flask/testing.py","line":12,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 266: \"\"\"A :class:`~click.testing.CliRunner` for testing a Flask app's","file":"src/flask/testing.py","line":266,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 268: :meth:`~flask.Flask.test_cli_runner`. See :ref:`testing-cli`.","file":"src/flask/testing.py","line":268,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 279: :meth:`CliRunner.invoke ` for","file":"src/flask/testing.py","line":279,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 14: from click.testing import CliRunner","file":"tests/test_cli.py","line":14,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 288: def test_app_cli_has_app_context(app, runner):","file":"tests/test_cli.py","line":288,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 338: result = runner.invoke(cli, [\"test\"], obj=obj)","file":"tests/test_cli.py","line":338,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 342: result = runner.invoke(cli, [\"subgroup\", \"test2\"], obj=obj)","file":"tests/test_cli.py","line":342,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Wie initialisiert diese Methode den Client?","query":"client init","file":"examples/tutorial/tests/conftest.py","symbol":"__init__","line":48,"lang":"de","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 230: def __init__(self, client):","file":"docs/tutorial/tests.rst","line":230,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 48: def __init__(self, client):","file":"examples/tutorial/tests/conftest.py","line":48,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/app.py\nLine 790: super(CustomClient,self).__init__( *args, **kwargs)","file":"src/flask/app.py","line":790,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 256: def test_init_once(app, client):","file":"tests/test_views.py","line":256,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"初始化数据库并创建表","query":"init db","file":"examples/tutorial/flaskr/db.py","symbol":"init_db_command","line":42,"lang":"zh","candidates":[{"text":"File: docs/appcontext.rst\nLine 66: init_db()","file":"docs/appcontext.rst","line":66,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/extensiondev.rst\nLine 219: def __init__(self, db):","file":"docs/extensiondev.rst","line":219,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/extensiondev.rst\nLine 231: db.init_app(app)","file":"docs/extensiondev.rst","line":231,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 32: db.init_app(app)","file":"docs/patterns/appfactories.rst","line":32,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 81: db.init_app(app)","file":"docs/patterns/appfactories.rst","line":81,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 46: def init_db():","file":"docs/patterns/sqlalchemy.rst","line":46,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 49: # you will have to import them first before calling init_db()","file":"docs/patterns/sqlalchemy.rst","line":49,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 88: To create the database you can use the `init_db` function:","file":"docs/patterns/sqlalchemy.rst","line":88,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 90: >>> from yourapplication.database import init_db","file":"docs/patterns/sqlalchemy.rst","line":90,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 91: >>> init_db()","file":"docs/patterns/sqlalchemy.rst","line":91,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 131: def init_db():","file":"docs/patterns/sqlalchemy.rst","line":131,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 137: def init_db():","file":"docs/patterns/sqlite3.rst","line":137,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 146: >>> from yourapplication import init_db","file":"docs/patterns/sqlite3.rst","line":146,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 147: >>> init_db()","file":"docs/patterns/sqlite3.rst","line":147,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 123: def init_db():","file":"docs/tutorial/database.rst","line":123,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 130: @click.command('init-db')","file":"docs/tutorial/database.rst","line":130,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 131: def init_db_command():","file":"docs/tutorial/database.rst","line":131,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 133: init_db()","file":"docs/tutorial/database.rst","line":133,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 147: :func:`click.command` defines a command line command called ``init-db``","file":"docs/tutorial/database.rst","line":147,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 148: that calls the ``init_db`` function and shows a success message to the","file":"docs/tutorial/database.rst","line":148,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 159: The ``close_db`` and ``init_db_command`` functions need to be registered","file":"docs/tutorial/database.rst","line":159,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 170: app.cli.add_command(init_db_command)","file":"docs/tutorial/database.rst","line":170,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 190: db.init_app(app)","file":"docs/tutorial/database.rst","line":190,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 198: Now that ``init-db`` has been registered with the app, it can be called","file":"docs/tutorial/database.rst","line":198,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 209: Run the ``init-db`` command:","file":"docs/tutorial/database.rst","line":209,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 213: $ flask --app flaskr init-db","file":"docs/tutorial/database.rst","line":213,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 39: Since this is a different machine, you need to run ``init-db`` again to","file":"docs/tutorial/deploy.rst","line":39,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 44: $ flask --app flaskr init-db","file":"docs/tutorial/deploy.rst","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 75: from flaskr.db import get_db, init_db","file":"docs/tutorial/tests.rst","line":75,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 91: init_db()","file":"docs/tutorial/tests.rst","line":91,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 193: The ``init-db`` command should call the ``init_db`` function and output","file":"docs/tutorial/tests.rst","line":193,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 199: def test_init_db_command(runner, monkeypatch):","file":"docs/tutorial/tests.rst","line":199,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Setze den Wert aus dem Request-Formular in die Flask-Sitzung und gebe eine Bestätigung zurück. Dies ist Teil der Tests für die Anforderungskontext-Verarbeitung.","query":"set session value","file":"tests/test_reqctx.py","symbol":"set","line":218,"lang":"de","candidates":[{"text":"File: docs/config.rst\nLine 156: The value of the ``Domain`` parameter on the session cookie. If not set, browsers","file":"docs/config.rst","line":156,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 222: If you want to access or set a value in the session *before* making a","file":"docs/testing.rst","line":222,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sessions.py\nLine 176: \"\"\"The value of the ``Domain`` parameter on the session cookie. If not set,","file":"src/flask/sessions.py","line":176,"lexical":0.65,"target":false},{"text":"File: src/flask/sessions.py\nLine 204: just returns the value of the ``SESSION_COOKIE_SECURE`` setting.","file":"src/flask/sessions.py","line":204,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"renvoyer le nombre maximal de champs autorisés dans un corps multipart","query":"max form parts limit","file":"src/flask/wrappers.py","symbol":"max_form_parts","line":120,"lang":"fr","candidates":[{"text":"File: docs/config.rst\nLine 346: :attr:`.Request.max_form_memory_parts` to apply the limit to that specific","file":"docs/config.rst","line":346,"lexical":0.5,"target":false},{"text":"File: docs/config.rst\nLine 362: :attr:`.Request.max_form_parts` to apply the limit to that specific view.","file":"docs/config.rst","line":362,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"Hay un error en el proceso de limpieza de la aplicación que lanza una excepción inesperada y rompe el flujo de finalización después de incrementar el contador de ciclos de vida.","query":"app teardown exception","file":"tests/test_appctx.py","symbol":"app_teardown","line":226,"lang":"es","candidates":[{"text":"File: tests/test_appctx.py\nLine 226: def app_teardown(e: Exception | None) -> None:","file":"tests/test_appctx.py","line":226,"lexical":0.65,"target":true},{"text":"File: tests/test_reqctx.py\nLine 29: def test_teardown_with_previous_exception(app):","file":"tests/test_reqctx.py","line":29,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 46: def test_teardown_with_handled_exception(app):","file":"tests/test_reqctx.py","line":46,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"注销接口发送的是 GET 请求,这可能导致某些不符合 RESTful 规范的客户端或代理服务器出现问题,建议确认是否应该改为 POST 请求以确保安全性。","query":"auth logout get","file":"examples/tutorial/tests/conftest.py","symbol":"logout","line":56,"lang":"zh","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 240: return self._client.get('/auth/logout')","file":"docs/tutorial/tests.rst","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 57: return self._client.get(\"/auth/logout\")","file":"examples/tutorial/tests/conftest.py","line":57,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"这个装饰器是在哪里用来把变量注入到模板全局上下文里的?","query":"template global decorator","file":"src/flask/sansio/blueprints.py","symbol":"app_template_global","line":558,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 182: :meth:`~.Flask.template_global` decorator or :meth:`~.Flask.add_template_global`","file":"docs/templating.rst","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 803: def decorator(f: T_template_global) -> T_template_global:","file":"src/flask/sansio/app.py","line":803,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 815: The :meth:`template_global` decorator can be used to register a function","file":"src/flask/sansio/app.py","line":815,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 583: def decorator(f: T_template_global) -> T_template_global:","file":"src/flask/sansio/blueprints.py","line":583,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 595: The :meth:`app_template_global` decorator can be used to register a function","file":"src/flask/sansio/blueprints.py","line":595,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"prüfe ob flask app konfiguration aus umgebungsvariable fehlschlägt wenn sie nicht gesetzt ist oder erfolgreich lädt wenn sie gesetzt ist","query":"config envvar test","file":"tests/test_config.py","symbol":"test_config_from_envvar","line":144,"lang":"de","candidates":[{"text":"File: tests/test_config.py\nLine 144: def test_config_from_envvar(monkeypatch):","file":"tests/test_config.py","line":144,"lexical":0.65,"target":true},{"text":"File: tests/test_config.py\nLine 161: def test_config_from_envvar_missing(monkeypatch):","file":"tests/test_config.py","line":161,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Preciso verificar se o contexto atual está vinculado a uma requisição HTTP ativa. Como posso fazer essa verificação de forma segura dentro do contexto do Flask?","query":"has active request","file":"src/flask/ctx.py","symbol":"has_request","line":351,"lang":"pt","candidates":[{"text":"File: src/flask/ctx.py\nLine 210: \"\"\"Test if an app context is active and if it has request information.","file":"src/flask/ctx.py","line":210,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/ctx.py\nLine 236: \"\"\"Test if an app context is active. Unlike :func:`has_request_context`","file":"src/flask/ctx.py","line":236,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"verify that searching for a non-existent application triggers the correct exception","query":"raises noappexception","file":"tests/test_cli.py","symbol":"test_locate_app_raises","line":216,"lang":"en","candidates":[{"text":"File: tests/test_cli.py\nLine 111: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":111,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_cli.py\nLine 117: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":117,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 124: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":124,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 217: with pytest.raises(NoAppException):","file":"tests/test_cli.py","line":217,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 226: with pytest.raises(NoAppException):","file":"tests/test_cli.py","line":226,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_cli.py\nLine 273: pytest.raises(NoAppException, obj.load_app)","file":"tests/test_cli.py","line":273,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"mostra como carregar configurações de um arquivo python","query":"load config file","file":"src/flask/config.py","symbol":"from_pyfile","line":187,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 439: ``config.from_file(name, load=json.load)``.","file":"CHANGES.rst","line":439,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 594: - Add ``Config.from_file`` to load config using arbitrary file","file":"CHANGES.rst","line":594,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 977: - Loading config files with ``silent=True`` will ignore ``ENOTDIR``","file":"CHANGES.rst","line":977,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 517: methods on the config object as well to load from individual files. For a","file":"docs/config.rst","line":517,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 525: It is also possible to load configuration from a file in a format of","file":"docs/config.rst","line":525,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 526: your choice using :meth:`~flask.Config.from_file`. For example to load","file":"docs/config.rst","line":526,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 532: app.config.from_file(\"config.toml\", load=tomllib.load, text=False)","file":"docs/config.rst","line":532,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 539: app.config.from_file(\"config.json\", load=json.load)","file":"docs/config.rst","line":539,"lexical":0.65,"target":false},{"text":"File: docs/config.rst\nLine 810: Since the config object provided loading of configuration files from","file":"docs/config.rst","line":810,"lexical":0.65,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 65: file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))","file":"docs/patterns/fileuploads.rst","line":65,"lexical":0.65,"target":false},{"text":"File: src/flask/config.py\nLine 213: e.strerror = f\"Unable to load configuration file ({e.strerror})\"","file":"src/flask/config.py","line":213,"lexical":0.65,"target":true},{"text":"File: src/flask/config.py\nLine 263: \"\"\"Update the values in the config from a file that is loaded","file":"src/flask/config.py","line":263,"lexical":0.65,"target":false},{"text":"File: src/flask/config.py\nLine 270: app.config.from_file(\"config.json\", load=json.load)","file":"src/flask/config.py","line":270,"lexical":0.65,"target":false},{"text":"File: src/flask/config.py\nLine 273: app.config.from_file(\"config.toml\", load=tomllib.load, text=False)","file":"src/flask/config.py","line":273,"lexical":0.65,"target":false},{"text":"File: src/flask/config.py\nLine 299: e.strerror = f\"Unable to load configuration file ({e.strerror})\"","file":"src/flask/config.py","line":299,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 315: #: to load a config from files.","file":"src/flask/sansio/app.py","line":315,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_config.py\nLine 34: app.config.from_file(os.path.join(current_dir, \"static\", \"config.json\"), json.load)","file":"tests/test_config.py","line":34,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 168: \"[Errno 2] Unable to load configuration file (No such file or directory):\"","file":"tests/test_config.py","line":168,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 180: \"[Errno 2] Unable to load configuration file (No such file or directory):\"","file":"tests/test_config.py","line":180,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 189: app.config.from_file(\"missing.json\", load=json.load)","file":"tests/test_config.py","line":189,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 192: \"[Errno 2] Unable to load configuration file (No such file or directory):\"","file":"tests/test_config.py","line":192,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 195: assert not app.config.from_file(\"missing.json\", load=json.load, silent=True)","file":"tests/test_config.py","line":195,"lexical":0.65,"target":false},{"text":"File: uv.lock\nLine 635: sdist = { url = \"https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz\", hash = \"sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730\", size = 20503, upload-time…","file":"uv.lock","line":635,"lexical":0.44999999999999996,"target":false},{"text":"File: uv.lock\nLine 637: { url = \"https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl\", hash = \"sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12\", size = 7484, upload-tim…","file":"uv.lock","line":637,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"app_template_filter를 사용해 등록한 템플릿 필터가 jinja_env.filters에 제대로 적용되었는지 확인하는 테스트 코드를 찾아줘.","query":"template filter test","file":"tests/test_blueprints.py","symbol":"test_template_filter_with_name","line":400,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 144: filters, tests, and global functions for use in Jinja templates. They all follow","file":"docs/templating.rst","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 350: def test_template_filter(app):","file":"tests/test_blueprints.py","line":350,"lexical":0.65,"target":true},{"text":"File: tests/test_blueprints.py\nLine 387: def test_add_template_filter(app):","file":"tests/test_blueprints.py","line":387,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 400: def test_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":400,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 413: def test_add_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":413,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 426: def test_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":426,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 443: def test_template_filter_after_route_with_template(app, client):","file":"tests/test_blueprints.py","line":443,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 459: def test_add_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":459,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 476: def test_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":476,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 493: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":493,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 123: def test_template_filter(app):","file":"tests/test_templating.py","line":123,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 157: def test_add_template_filter(app):","file":"tests/test_templating.py","line":157,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 167: def test_template_filter_with_name(app):","file":"tests/test_templating.py","line":167,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 177: def test_add_template_filter_with_name(app):","file":"tests/test_templating.py","line":177,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 187: def test_template_filter_with_template(app, client):","file":"tests/test_templating.py","line":187,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 200: def test_add_template_filter_with_template(app, client):","file":"tests/test_templating.py","line":200,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 214: def test_template_filter_with_name_and_template(app, client):","file":"tests/test_templating.py","line":214,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 227: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_templating.py","line":227,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Como inicializar a aplicação Flask com configurações customizadas para caminhos estáticos e templates?","query":"Flask app init","file":"src/flask/app.py","symbol":"__init__","line":311,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 1088: - Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from","file":"CHANGES.rst","line":1088,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 46: def celery_init_app(app: Flask) -> Celery:","file":"docs/patterns/celery.rst","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 101: When using the Flask application factory pattern, call the ``celery_init_app`` function","file":"docs/patterns/celery.rst","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 213: $ flask --app flaskr init-db","file":"docs/tutorial/database.rst","line":213,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 44: $ flask --app flaskr init-db","file":"docs/tutorial/deploy.rst","line":44,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/src/task_app/__init__.py\nLine 29: def celery_init_app(app: Flask) -> Celery:","file":"examples/celery/src/task_app/__init__.py","line":29,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/README.rst\nLine 50: $ flask --app flaskr init-db","file":"examples/tutorial/README.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 271: def __init__(self, app: Flask, **kwargs: t.Any) -> None:","file":"src/flask/testing.py","line":271,"lexical":0.55,"target":false},{"text":"File: tests/test_instance_config.py\nLine 52: (ns / \"__init__.py\").write_text(\"import flask\\napp = flask.Flask(__name__)\\n\")","file":"tests/test_instance_config.py","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_instance_config.py\nLine 89: (app / \"__init__.py\").write_text(\"import flask\\napp = flask.Flask(__name__)\\n\")","file":"tests/test_instance_config.py","line":89,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_instance_config.py\nLine 104: (app / \"__init__.py\").write_text(\"import flask\\napp = flask.Flask(__name__)\\n\")","file":"tests/test_instance_config.py","line":104,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Hay un error en las pruebas de plantillas: el procesador encargado de añadir valores globales al contexto está devolviendo un entero estático en lugar de dinámico, lo que impide validar integraciones reales.","query":"context processor value","file":"tests/test_templating.py","symbol":"context_processor","line":13,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 1533: - Context processors will no longer override values passed directly to","file":"CHANGES.rst","line":1533,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 212: Variables are not limited to values; a context processor can also make","file":"docs/templating.rst","line":212,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"도움말 명령 실행 시 환경 변수 관련 오류 메시지 출력 여부 검증하는 테스트 찾아줘","query":"flask help error","file":"tests/test_cli.py","symbol":"test_help_echo_loading_error","line":412,"lang":"ko","candidates":[{"text":"File: tests/test_basic.py\nLine 1130: from flask.debughelpers import DebugFilesKeyError","file":"tests/test_basic.py","line":1130,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 212: Avoiding ``__import__`` helps create Flask instances where there are errors","file":"tests/test_helpers.py","line":212,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Flaskのデフォルト環境変数にremote_addrとuser_agentが正しく設定されるか確認するテストを作成してください。","query":"test default environ","file":"tests/test_testing.py","symbol":"test_environ_base_default","line":42,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 1078: - ``app.test_client`` includes preset default environment, which can","file":"CHANGES.rst","line":1078,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1537: :class:`~werkzeug.test.EnvironBuilder`, with some defaults from","file":"src/flask/app.py","line":1537,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 28: \"\"\"An :class:`~werkzeug.test.EnvironBuilder`, that takes defaults from the","file":"src/flask/testing.py","line":28,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 116: `app.test_client()` includes preset default environment, which can be","file":"src/flask/testing.py","line":116,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 15: def test_environ_defaults_from_config(app, client):","file":"tests/test_testing.py","line":15,"lexical":0.65,"target":true},{"text":"File: tests/test_testing.py\nLine 30: def test_environ_defaults(app, client, app_ctx, req_ctx):","file":"tests/test_testing.py","line":30,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 42: def test_environ_base_default(app, client):","file":"tests/test_testing.py","line":42,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"전체 요청 전에 실행되는 함수를 등록하는 방법을 찾아주세요. 예를 들어 데이터베이스 연결을 열거나 세션에서 로그인된 사용자를 로드하는 데 사용할 수 있습니다.","query":"before request function","file":"src/flask/sansio/scaffold.py","symbol":"before_request","line":468,"lang":"ko","candidates":[{"text":"File: docs/api.rst\nLine 161: :meth:`~.Flask.before_request` function could load a user object from a","file":"docs/api.rst","line":161,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 156: Blueprint-specific before request functions, etc. registered with the","file":"docs/blueprints.rst","line":156,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 131: #. Any :meth:`~.Flask.before_request` decorated functions are called. If any of","file":"docs/lifecycle.rst","line":131,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 139: #. Whatever returned a response value - a before request function, the view, or an","file":"docs/lifecycle.rst","line":139,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 309: code, so ``before_request`` functions are not called. If you need to","file":"docs/testing.rst","line":309,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 133: #: To register a function, use the :meth:`before_request`","file":"src/flask/sansio/scaffold.py","line":133,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/scaffold.py\nLine 469: \"\"\"Register a function to run before each request.","file":"src/flask/sansio/scaffold.py","line":469,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 527: teardown functions are called just before the request context is","file":"src/flask/sansio/scaffold.py","line":527,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 573: :meth:`before_request` functions.","file":"src/flask/sansio/scaffold.py","line":573,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"find the function that renders the admin dashboard template","query":"admin index template","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","symbol":"index2","line":19,"lang":"en","candidates":[{"text":"File: docs/blueprints.rst\nLine 240: want to render the template ``'admin/index.html'`` and you have provided","file":"docs/blueprints.rst","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 242: this: :file:`yourapplication/admin/templates/admin/index.html`. The reason","file":"docs/blueprints.rst","line":242,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 259: And then when you want to render the template, use :file:`admin/index.html` as","file":"docs/blueprints.rst","line":259,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/blueprintapp/apps/admin/__init__.py\nLine 15: return render_template(\"admin/index.html\")","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","line":15,"lexical":0.55,"target":true},{"text":"File: tests/test_apps/blueprintapp/apps/admin/__init__.py\nLine 20: return render_template(\"./admin/index.html\")","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","line":20,"lexical":0.55,"target":false},{"text":"File: tests/test_blueprints.py\nLine 239: assert templates == [\"admin/index.html\", \"frontend/index.html\"]","file":"tests/test_blueprints.py","line":239,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Show me the function that sets a value in the session for testing purposes and returns a simple string.","query":"session testing 42","file":"tests/test_basic.py","symbol":"index","line":326,"lang":"en","candidates":[{"text":"File: tests/test_basic.py\nLine 284: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":284,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_basic.py\nLine 306: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":306,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 327: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":327,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 359: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":359,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"suche die funktion die sicherstellt dass eine setup-funktion nur beim ersten registrieren aufgerufen wird","query":"record once","file":"src/flask/sansio/blueprints.py","symbol":"record_once","line":233,"lang":"de","candidates":[{"text":"File: docs/blueprints.rst\nLine 51: The basic concept of blueprints is that they record operations to execute","file":"docs/blueprints.rst","line":51,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 233: def record_once(self, func: DeferredSetupFunction) -> None:","file":"src/flask/sansio/blueprints.py","line":233,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 495: self.record_once(register_template_filter)","file":"src/flask/sansio/blueprints.py","line":495,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 553: self.record_once(register_template_test)","file":"src/flask/sansio/blueprints.py","line":553,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 611: self.record_once(register_template_global)","file":"src/flask/sansio/blueprints.py","line":611,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 618: self.record_once(","file":"src/flask/sansio/blueprints.py","line":618,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 628: self.record_once(","file":"src/flask/sansio/blueprints.py","line":628,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 638: self.record_once(","file":"src/flask/sansio/blueprints.py","line":638,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 650: self.record_once(","file":"src/flask/sansio/blueprints.py","line":650,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 667: self.record_once(from_blueprint)","file":"src/flask/sansio/blueprints.py","line":667,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 679: self.record_once(","file":"src/flask/sansio/blueprints.py","line":679,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 689: self.record_once(","file":"src/flask/sansio/blueprints.py","line":689,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"チュートリアルのセクションで、新しいコンテンツを作成する方法について説明している箇所はどこですか?","query":"tutorial create","file":"docs/tutorial/blog.rst","symbol":"Create","line":131,"lang":"ja","candidates":[{"text":"File: docs/index.rst\nLine 16: more detailed :doc:`tutorial/index` that shows how to create a small but","file":"docs/index.rst","line":16,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 117: tutorial. It creates a connection between the URL ``/hello`` and a","file":"docs/tutorial/factory.rst","line":117,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"Estou escrevendo novos testes para a lógica de tratamento de erros. Você pode me mostrar como o sistema valida quando uma exceção de nível superior é capturada?","query":"parent exception handler","file":"tests/test_user_error_handler.py","symbol":"parent_exception_handler","line":72,"lang":"pt","candidates":[{"text":"File: docs/blueprints.rst\nLine 158: handler that can handle a given exception, the parent's will be tried.","file":"docs/blueprints.rst","line":158,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 71: @app.errorhandler(ParentException)","file":"tests/test_user_error_handler.py","line":71,"lexical":0.65,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 72: def parent_exception_handler(e):","file":"tests/test_user_error_handler.py","line":72,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"ログ出力に関するデフォルトの設定値がドキュメントに記載されていない箇所があります。初期設定の挙動を確認したいです。","query":"default logging config","file":"docs/logging.rst","symbol":"Default Configuration","line":59,"lang":"ja","candidates":[{"text":"File: docs/logging.rst\nLine 23: If you don't configure logging, Python's default log level is usually","file":"docs/logging.rst","line":23,"lexical":0.65,"target":true},{"text":"File: docs/logging.rst\nLine 32: is accessed before logging is configured, it will add a default handler. If","file":"docs/logging.rst","line":32,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Estoy revisando la lógica de validación de los metadatos. ¿Podrías decirme dónde se comprueba si el valor recibido es un diccionario?","query":"isinstance dict value","file":"src/flask/json/tag.py","symbol":"check","line":122,"lang":"es","candidates":[{"text":"File: src/flask/cli.py\nLine 55: matches = [v for v in module.__dict__.values() if isinstance(v, Flask)]","file":"src/flask/cli.py","line":55,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/tag.py\nLine 33: return isinstance(value, OrderedDict)","file":"src/flask/json/tag.py","line":33,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/json/tag.py\nLine 105: isinstance(value, dict)","file":"src/flask/json/tag.py","line":105,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/tag.py\nLine 123: return isinstance(value, dict)","file":"src/flask/json/tag.py","line":123,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/tag.py\nLine 310: if isinstance(value, dict):","file":"src/flask/json/tag.py","line":310,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"The method used to access files within a blueprint's directory is throwing a ValueError if I try to use any mode other than the predefined reading options, even though the documentation implies it should handle multiple read modes. It seems to be restricting access strictly to specific read-only patterns.","query":"blueprint open resource","file":"src/flask/blueprints.py","symbol":"open_resource","line":104,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 81: ``Blueprint.open_resource`` take an ``encoding`` parameter to use when","file":"CHANGES.rst","line":81,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 186: :meth:`~Blueprint.open_resource` function::","file":"docs/blueprints.rst","line":186,"lexical":0.65,"target":false},{"text":"File: src/flask/blueprints.py\nLine 108: blueprint-relative equivalent of the app's :meth:`~.Flask.open_resource`","file":"src/flask/blueprints.py","line":108,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"프로젝트에서 사용할 수 있는 시그널 목록과 각 시그널의 용도를 설명해줘","query":"signal list","file":"docs/signals.rst","symbol":"Signals","line":1,"lang":"ko","candidates":[{"text":"File: docs/api.rst\nLine 322: .. _core-signals-list:","file":"docs/api.rst","line":322,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/signals.rst\nLine 23: See :ref:`core-signals-list` for a list of all built-in signals. The :doc:`lifecycle`","file":"docs/signals.rst","line":23,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/signals.rst\nLine 38: unless you really want to listen for signals from all applications. This is","file":"docs/signals.rst","line":38,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"Como o objeto principal do framework processa a requisição WSGI para delegar ao método que suporta middlewares?","query":"wsgi app call","file":"src/flask/app.py","symbol":"__call__","line":1621,"lang":"pt","candidates":[{"text":"File: docs/design.rst\nLine 13: A Python web application based on WSGI has to have one central callable","file":"docs/design.rst","line":13,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 75: into a WSGI environ, and call the WSGI application with that data. The WSGI application","file":"docs/lifecycle.rst","line":75,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 81: #. WSGI server calls WSGI application with the ``environ``.","file":"docs/lifecycle.rst","line":81,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 93: The WSGI application above is a callable that behaves in a certain way. Middleware","file":"docs/lifecycle.rst","line":93,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 96: the data passed to it, then call the WSGI application (or further middleware) that it","file":"docs/lifecycle.rst","line":96,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 99: From the WSGI server's perspective, there is one WSGI application, the one it calls","file":"docs/lifecycle.rst","line":99,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 101: middleware. But even Flask can call further WSGI applications, although that's an","file":"docs/lifecycle.rst","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 119: #. WSGI server calls the Flask object, which calls :meth:`.Flask.wsgi_app`.","file":"docs/lifecycle.rst","line":119,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1269: The function is called as a WSGI application. The result is","file":"src/flask/app.py","line":1269,"lexical":0.65,"target":true},{"text":"File: src/flask/app.py\nLine 1624: \"\"\"The WSGI server calls the Flask application object as the","file":"src/flask/app.py","line":1624,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1625: WSGI application. This calls :meth:`wsgi_app`, which can be","file":"src/flask/app.py","line":1625,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"이전 예외 발생 시 리퀘스트 종료 핸들러 동작 확인해줘","query":"teardown exception test","file":"tests/test_reqctx.py","symbol":"test_teardown_with_previous_exception","line":29,"lang":"ko","candidates":[{"text":"File: tests/test_appctx.py\nLine 250: with pytest.raises(ExceptionGroup, match=\"context teardown\") as exc_info: # noqa: F821","file":"tests/test_appctx.py","line":250,"lexical":0.65,"target":false},{"text":"File: tests/test_reqctx.py\nLine 29: def test_teardown_with_previous_exception(app):","file":"tests/test_reqctx.py","line":29,"lexical":0.65,"target":true},{"text":"File: tests/test_reqctx.py\nLine 46: def test_teardown_with_handled_exception(app):","file":"tests/test_reqctx.py","line":46,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"我正在处理文件下载相关的逻辑,能帮我找一下那个用来从应用上下文中提取参数并填充给文件发送函数的工具函数吗?我想看看它是怎么处理缓存时间设置的。","query":"prepare send file","file":"src/flask/helpers.py","symbol":"_prepare_send_file_kwargs","line":402,"lang":"zh","candidates":[{"text":"File: src/flask/helpers.py\nLine 402: def _prepare_send_file_kwargs(**kwargs: t.Any) -> dict[str, t.Any]:","file":"src/flask/helpers.py","line":402,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/helpers.py\nLine 529: **_prepare_send_file_kwargs(","file":"src/flask/helpers.py","line":529,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 583: directory, path, **_prepare_send_file_kwargs(**kwargs)","file":"src/flask/helpers.py","line":583,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Estou tentando entender como o framework gerencia a inicialização de aplicações via linha de comando. Onde fica definida a estrutura que armazena os parâmetros de importação e a função de criação do app para o dispatch do click?","query":"flask app import","file":"src/flask/cli.py","symbol":"ScriptInfo","line":293,"lang":"pt","candidates":[{"text":"File: docs/api.rst\nLine 453: from flask import appcontext_tearing_down","file":"docs/api.rst","line":453,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 469: from flask import appcontext_pushed","file":"docs/api.rst","line":469,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 346: from flask.cli import AppGroup","file":"docs/cli.rst","line":346,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 434: from flask.cli import with_appcontext","file":"docs/cli.rst","line":434,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 547: debug mode. ``--app hello`` should be the import or file with your Flask app.","file":"docs/cli.rst","line":547,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 46: from flask import current_app, Blueprint, render_template","file":"docs/patterns/appfactories.rst","line":46,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 43: from flask import current_app, g","file":"docs/tutorial/database.rst","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 95: ``--app`` like ``flask run`` does. You need to tell it to import and","file":"docs/tutorial/deploy.rst","line":95,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 74: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":74,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 150: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":150,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/db.py\nLine 5: from flask import current_app","file":"examples/tutorial/flaskr/db.py","line":5,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 6: from flaskr import create_app","file":"examples/tutorial/tests/conftest.py","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_factory.py\nLine 1: from flaskr import create_app","file":"examples/tutorial/tests/test_factory.py","line":1,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/__init__.py\nLine 2: from .app import Flask as Flask","file":"src/flask/__init__.py","line":2,"lexical":0.55,"target":false},{"text":"File: src/flask/app.py\nLine 150: import name of your application. For example the Flask-SQLAlchemy","file":"src/flask/app.py","line":150,"lexical":0.65,"target":false},{"text":"File: src/flask/cli.py\nLine 34: from .app import Flask","file":"src/flask/cli.py","line":34,"lexical":0.55,"target":true},{"text":"File: src/flask/cli.py\nLine 312: #: Optionally the import path for the Flask application.","file":"src/flask/cli.py","line":312,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 774: click.echo(f\" * Serving Flask app '{app_import_path}'\")","file":"src/flask/cli.py","line":774,"lexical":0.55,"target":false},{"text":"File: src/flask/ctx.py\nLine 21: from .app import Flask","file":"src/flask/ctx.py","line":21,"lexical":0.55,"target":false},{"text":"File: src/flask/ctx.py\nLine 241: from flask import has_app_context, g","file":"src/flask/ctx.py","line":241,"lexical":0.55,"target":false},{"text":"File: src/flask/globals.py\nLine 9: from .app import Flask","file":"src/flask/globals.py","line":9,"lexical":0.55,"target":false},{"text":"File: src/flask/logging.py\nLine 62: :attr:`app.import_name `.","file":"src/flask/logging.py","line":62,"lexical":0.55,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 99: import name of your application. For example the Flask-SQLAlchemy","file":"src/flask/sansio/app.py","line":99,"lexical":0.65,"target":false},{"text":"File: src/flask/sessions.py\nLine 19: from .app import Flask","file":"src/flask/sessions.py","line":19,"lexical":0.55,"target":false},{"text":"File: src/flask/testing.py\nLine 24: from .app import Flask","file":"src/flask/testing.py","line":24,"lexical":0.55,"target":false},{"text":"File: tests/conftest.py\nLine 7: from flask.globals import app_ctx as _app_ctx","file":"tests/conftest.py","line":7,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 6: from flask.globals import app_ctx","file":"tests/test_appctx.py","line":6,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 24: from flask.globals import app_ctx","file":"tests/test_basic.py","line":24,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 17: from flask import current_app","file":"tests/test_cli.py","line":17,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 19: from flask.cli import AppGroup","file":"tests/test_cli.py","line":19,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 20: from flask.cli import find_best_app","file":"tests/test_cli.py","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 24: from flask.cli import locate_app","file":"tests/test_cli.py","line":24,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"リクエスト終了時のクリーンアップ処理が正しく動作するか確認するテストを書いて","query":"teardown request test","file":"tests/test_reqctx.py","symbol":"test_teardown_on_pop","line":15,"lang":"ja","candidates":[{"text":"File: tests/test_appctx.py\nLine 262: with pytest.raises(ValueError, match=\"request_teardown\"):","file":"tests/test_appctx.py","line":262,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 777: def test_teardown_request_handler(app, client):","file":"tests/test_basic.py","line":777,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 795: def test_teardown_request_handler_debug_mode(app, client):","file":"tests/test_basic.py","line":795,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 813: def test_teardown_request_handler_error(app, client):","file":"tests/test_basic.py","line":813,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 822: # test that all teardown_requests get passed the same original","file":"tests/test_basic.py","line":822,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 834: # test that all teardown_requests get passed the same original","file":"tests/test_basic.py","line":834,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Ich prüfe, ob der gegebene Wert tatsächlich eine Liste ist, um sicherzustellen, dass die Datenstruktur den Erwartungen entspricht.","query":"is value list","file":"src/flask/json/tag.py","symbol":"check","line":150,"lang":"de","candidates":[{"text":"File: docs/config.rst\nLine 605: value is possible, including lists and dicts. This is configurable via","file":"docs/config.rst","line":605,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 640: return value is a dict or list, :func:`jsonify` is called to produce a","file":"docs/quickstart.rst","line":640,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1257: ``headers`` is a dictionary or a list of ``(key, value)``","file":"src/flask/app.py","line":1257,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 868: \"\"\"Click option type that accepts a list of values separated by the","file":"src/flask/cli.py","line":868,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/debughelpers.py\nLine 112: if isinstance(value, (tuple, list)):","file":"src/flask/debughelpers.py","line":112,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/tag.py\nLine 18: to handle this we will dump the items as a list of ``[key, value]``","file":"src/flask/json/tag.py","line":18,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/json/tag.py\nLine 151: return isinstance(value, list)","file":"src/flask/json/tag.py","line":151,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/tag.py\nLine 315: elif isinstance(value, list):","file":"src/flask/json/tag.py","line":315,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 397: #: return ','.join(super(ListConverter, self).to_url(value)","file":"src/flask/sansio/app.py","line":397,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 199: list[ft.URLValuePreprocessorCallable],","file":"src/flask/sansio/scaffold.py","line":199,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/typing.py\nLine 26: HeaderValue = str | list[str] | tuple[str, ...]","file":"src/flask/typing.py","line":26,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 27: assert \"'list' is not a subclass of Exception.\" in str(exc_info.value)","file":"tests/test_user_error_handler.py","line":27,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"busca la función que renderiza la plantilla principal del panel de administración","query":"admin index template","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","symbol":"index","line":14,"lang":"es","candidates":[{"text":"File: docs/blueprints.rst\nLine 240: want to render the template ``'admin/index.html'`` and you have provided","file":"docs/blueprints.rst","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 242: this: :file:`yourapplication/admin/templates/admin/index.html`. The reason","file":"docs/blueprints.rst","line":242,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 259: And then when you want to render the template, use :file:`admin/index.html` as","file":"docs/blueprints.rst","line":259,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/blueprintapp/apps/admin/__init__.py\nLine 15: return render_template(\"admin/index.html\")","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","line":15,"lexical":0.55,"target":true},{"text":"File: tests/test_apps/blueprintapp/apps/admin/__init__.py\nLine 20: return render_template(\"./admin/index.html\")","file":"tests/test_apps/blueprintapp/apps/admin/__init__.py","line":20,"lexical":0.55,"target":false},{"text":"File: tests/test_blueprints.py\nLine 239: assert templates == [\"admin/index.html\", \"frontend/index.html\"]","file":"tests/test_blueprints.py","line":239,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Die Testfunktion für den Startpunkt der Anwendung wirft fälschlicherweise einen Fehler aus, anstatt die Umgebung korrekt zu initialisieren.","query":"raise ValueError dummy","file":"tests/test_appctx.py","symbol":"index","line":125,"lang":"de","candidates":[{"text":"File: tests/test_appctx.py\nLine 126: raise ValueError(\"dummy\")","file":"tests/test_appctx.py","line":126,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_appctx.py\nLine 128: with pytest.raises(ValueError, match=\"dummy\"):","file":"tests/test_appctx.py","line":128,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Investigate why an error is being raised when attempting to initialize a modular component of the application using a name that includes a period or is an empty string.","query":"empty name ValueError","file":"src/flask/sansio/blueprints.py","symbol":"__init__","line":174,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 223: - If a blueprint is created with an empty name it raises a ``ValueError``.","file":"CHANGES.rst","line":223,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 196: raise ValueError(\"'name' may not be empty.\")","file":"src/flask/sansio/blueprints.py","line":196,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"블로그 템플릿 구조 정의하는 부분 찾아줘","query":"blog blueprint","file":"docs/tutorial/blog.rst","symbol":"Blog Blueprint","line":3,"lang":"ko","candidates":[{"text":"File: docs/errorhandling.rst\nLine 380: blog = Blueprint('blog', __name__)","file":"docs/errorhandling.rst","line":380,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 3: Blog Blueprint","file":"docs/tutorial/blog.rst","line":3,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/tutorial/blog.rst\nLine 7: authentication blueprint to write the blog blueprint. The blog should","file":"docs/tutorial/blog.rst","line":7,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 31: bp = Blueprint('blog', __name__)","file":"docs/tutorial/blog.rst","line":31,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 45: app.register_blueprint(blog.bp)","file":"docs/tutorial/blog.rst","line":45,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 51: Unlike the auth blueprint, the blog blueprint does not have a","file":"docs/tutorial/blog.rst","line":51,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 63: In another application you might give the blog blueprint a","file":"docs/tutorial/blog.rst","line":63,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 23: one for the blog posts functions. The code for each blueprint will go","file":"docs/tutorial/views.rst","line":23,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 40: app.register_blueprint(blog.bp)","file":"examples/tutorial/flaskr/__init__.py","line":40,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 44: # app.route, while giving the blog blueprint a url_prefix, but for","file":"examples/tutorial/flaskr/__init__.py","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/blog.py\nLine 13: bp = Blueprint(\"blog\", __name__)","file":"examples/tutorial/flaskr/blog.py","line":13,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm reviewing how a Flask blueprint initializes its internal state and CLI command group. Please show me the constructor that sets up these configuration attributes.","query":"flask blueprint init","file":"src/flask/blueprints.py","symbol":"__init__","line":19,"lang":"en","candidates":[{"text":"File: tests/test_blueprints.py\nLine 1008: parent = flask.Blueprint(\"parent\", __name__, url_prefix=parent_init)","file":"tests/test_blueprints.py","line":1008,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1009: child = flask.Blueprint(\"child\", __name__, url_prefix=child_init)","file":"tests/test_blueprints.py","line":1009,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"cómo configurar la aplicación en el tutorial de fábrica","query":"app setup","file":"docs/tutorial/factory.rst","symbol":"Application Setup","line":3,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 344: this will become an error just like the application setup methods.","file":"CHANGES.rst","line":344,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/conf.py\nLine 100: def setup(app):","file":"docs/conf.py","line":100,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/extensiondev.rst\nLine 155: Configuration should not be changed after the application setup phase is","file":"docs/extensiondev.rst","line":155,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 6: during application setup, serving, and handling requests will help you know what's","file":"docs/lifecycle.rst","line":6,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 10: Application Setup","file":"docs/lifecycle.rst","line":10,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 31: This is known as the \"application setup phase\", it's the code you write that's outside","file":"docs/lifecycle.rst","line":31,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 36: All application setup must be completed before you start serving your application and","file":"docs/lifecycle.rst","line":36,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 45: The setup method 'route' can no longer be called on the application. It has already","file":"docs/lifecycle.rst","line":45,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 127: decorator during application setup. If there is no match, the error - usually a 404,","file":"docs/lifecycle.rst","line":127,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 82: application is served. In simple setups, this is ``/``, but it might","file":"docs/patterns/javascript.rst","line":82,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/shell.rst\nLine 7: shell with some setup done to make working with the Flask app easier.","file":"docs/shell.rst","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 40: setup, yield a value, then do teardown. Fixtures for the application,","file":"docs/testing.rst","line":40,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 3: Application Setup","file":"docs/tutorial/factory.rst","line":3,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/ctx.py\nLine 268: app context if needed during setup, and :meth:`.Flask.test_request_context`","file":"src/flask/ctx.py","line":268,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 240: def wrapper(state: BlueprintSetupState) -> None:","file":"src/flask/sansio/blueprints.py","line":240,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 253: return BlueprintSetupState(self, app, options, first_registration)","file":"src/flask/sansio/blueprints.py","line":253,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 276: application. Creates a :class:`.BlueprintSetupState` and calls","file":"src/flask/sansio/blueprints.py","line":276,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 321: state = self.make_setup_state(app, options, first_bp_registration)","file":"src/flask/sansio/blueprints.py","line":321,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1707: def test_no_setup_after_first_request(app, client):","file":"tests/test_basic.py","line":1707,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"ermittle die zeitspanne für den browsercache beim versenden von dateien","query":"send_file max_age","file":"src/flask/app.py","symbol":"get_send_file_max_age","line":366,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 195: - The ``session_cookie_name``, ``send_file_max_age_default``, ``use_x_sendfile``,","file":"CHANGES.rst","line":195,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 312: ``session_cookie_name``, ``send_file_max_age_default``,","file":"CHANGES.rst","line":312,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 548: ``get_send_file_max_age``. :issue:`4044`, :pr:`4026`","file":"CHANGES.rst","line":548,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 632: - ``send_file`` sets ``conditional=True`` and ``max_age=None`` by","file":"CHANGES.rst","line":632,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1337: - ``Flask`` and ``Blueprint`` now provide a ``get_send_file_max_age``","file":"CHANGES.rst","line":1337,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1344: ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is used","file":"CHANGES.rst","line":1344,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1345: in the default ``get_send_file_max_age`` implementation.","file":"CHANGES.rst","line":1345,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 250: .. py:data:: SEND_FILE_MAX_AGE_DEFAULT","file":"docs/config.rst","line":250,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 255: :meth:`~flask.Flask.get_send_file_max_age` on the application or","file":"docs/config.rst","line":255,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 230: \"SEND_FILE_MAX_AGE_DEFAULT\": None,","file":"src/flask/app.py","line":230,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/app.py\nLine 366: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/app.py","line":366,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 367: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/app.py","line":367,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 370: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/app.py","line":370,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 383: value = self.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/app.py","line":383,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 408: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/app.py","line":408,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 410: max_age = self.get_send_file_max_age(filename)","file":"src/flask/app.py","line":410,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 55: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/blueprints.py","line":55,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 56: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/blueprints.py","line":56,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 59: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/blueprints.py","line":59,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 72: value = current_app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/blueprints.py","line":72,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 97: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/blueprints.py","line":97,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 99: max_age = self.get_send_file_max_age(filename)","file":"src/flask/blueprints.py","line":99,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 406: kwargs[\"max_age\"] = ctx.app.get_send_file_max_age","file":"src/flask/helpers.py","line":406,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 515: :meth:`Flask.get_send_file_max_age`.","file":"src/flask/helpers.py","line":515,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 194: max_age_default = app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"tests/test_blueprints.py","line":194,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 197: if app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] == expected_max_age:","file":"tests/test_blueprints.py","line":197,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 199: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = expected_max_age","file":"tests/test_blueprints.py","line":199,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 204: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = max_age_default","file":"tests/test_blueprints.py","line":204,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 223: def get_send_file_max_age(self, filename):","file":"tests/test_blueprints.py","line":223,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 55: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = 3600","file":"tests/test_helpers.py","line":55,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 70: def get_send_file_max_age(self, filename):","file":"tests/test_helpers.py","line":70,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Explique como o contexto da aplicação e o contexto da requisição funcionam neste serviço. Quero entender quando cada um está ativo e como eles se relacionam.","query":"app request context","file":"docs/appcontext.rst","symbol":"The App and Request Context","line":1,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 8: - ``RequestContext`` has merged with ``AppContext``. ``RequestContext`` is now","file":"CHANGES.rst","line":8,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 294: - The ``RequestContext.g`` property returning ``AppContext.g`` is","file":"CHANGES.rst","line":294,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 298: - The app and request contexts are managed using Python context vars","file":"CHANGES.rst","line":298,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 781: the app and request contexts, such as to query a database for an id.","file":"CHANGES.rst","line":781,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1241: - ``flask.g`` is now stored on the app context instead of the request","file":"CHANGES.rst","line":1241,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1330: - Added ``Flask.app_context`` which works very similar to the request","file":"CHANGES.rst","line":1330,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 39: This is only available when a :doc:`request context ` is","file":"docs/api.rst","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 70: This is only available when a :doc:`request context ` is","file":"docs/api.rst","line":70,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 169: Bound to the application context instead of the request context.","file":"docs/api.rst","line":169,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 304: This is only available when a :doc:`request context ` is","file":"docs/api.rst","line":304,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 367: any request processing happens. Because the request context is already","file":"docs/api.rst","line":367,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/appcontext.rst\nLine 1: The App and Request Context","file":"docs/appcontext.rst","line":1,"lexical":0.65,"target":true},{"text":"File: docs/appcontext.rst\nLine 107: with app.test_request_context(","file":"docs/appcontext.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/appcontext.rst\nLine 122: When a Flask application handles a request, it pushes a request context","file":"docs/appcontext.rst","line":122,"lexical":0.65,"target":false},{"text":"File: docs/extensiondev.rst\nLine 183: active during a request, CLI command, or ``with app.app_context()`` block. If","file":"docs/extensiondev.rst","line":183,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/extensiondev.rst\nLine 186: app context ends. If it should only be valid during a request, or would not be","file":"docs/extensiondev.rst","line":186,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 157: #. The app context is popped, :data:`.current_app`, :data:`.g`, :data:`.request`,","file":"docs/lifecycle.rst","line":157,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 161: When executing a CLI command or plain app context without request data, the same","file":"docs/lifecycle.rst","line":161,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 28: application context (which is always true if there is a request in flight)","file":"docs/patterns/sqlite3.rst","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 43: Please keep in mind that the teardown request and appcontext functions","file":"docs/patterns/sqlite3.rst","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/streaming.rst\nLine 72: :func:`.stream_with_context` wrapper. This will keep the request context active","file":"docs/patterns/streaming.rst","line":72,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 279: with app.test_request_context():","file":"docs/quickstart.rst","line":279,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 25: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 50: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 254: :func:`~flask.stream_with_context` wrapper if a request is active, so that","file":"docs/templating.rst","line":254,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 207: The app and request context will remain active *after* making a request,","file":"docs/testing.rst","line":207,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 279: active :doc:`app context ` because they access :data:`.request`,","file":"docs/testing.rst","line":279,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 294: Use ``with app.test_request_context()`` to push a request context. It","file":"docs/testing.rst","line":294,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 300: with app.test_request_context(","file":"docs/testing.rst","line":300,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 316: with app.test_request_context(\"/user/2/edit\", headers={\"X-Auth-Token\": \"1\"}):","file":"docs/testing.rst","line":316,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 969: def dispatch_request(self, ctx: AppContext) -> ft.ResponseReturnValue:","file":"src/flask/app.py","line":969,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 995: def full_dispatch_request(self, ctx: AppContext) -> Response:","file":"src/flask/app.py","line":995,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"find the view that returns a hardcoded string with a custom header","query":"response x-method","file":"tests/test_views.py","symbol":"Index","line":153,"lang":"en","candidates":[{"text":"File: tests/test_views.py\nLine 155: return flask.Response(\"Blub\", headers={\"X-Method\": flask.request.method})","file":"tests/test_views.py","line":155,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_views.py\nLine 172: return flask.Response(\"\", headers={\"X-Method\": \"HEAD\"})","file":"tests/test_views.py","line":172,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"trouve la fonction qui stocke l'adresse ip et l'agent utilisateur dans le contexte de la requête","query":"flask g remote_addr","file":"tests/test_testing.py","symbol":"index","line":44,"lang":"fr","candidates":[{"text":"File: tests/test_testing.py\nLine 45: flask.g.remote_addr = flask.request.remote_addr","file":"tests/test_testing.py","line":45,"lexical":0.65,"target":true},{"text":"File: tests/test_testing.py\nLine 51: assert flask.g.remote_addr == \"127.0.0.1\"","file":"tests/test_testing.py","line":51,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 60: flask.g.remote_addr = flask.request.remote_addr","file":"tests/test_testing.py","line":60,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 69: assert flask.g.remote_addr == \"192.168.0.22\"","file":"tests/test_testing.py","line":69,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"instanciar o framework web para os testes","query":"flask app test","file":"tests/test_cli.py","symbol":"create_app","line":94,"lang":"pt","candidates":[{"text":"File: docs/testing.rst\nLine 1: Testing Flask Applications","file":"docs/testing.rst","line":1,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 4: Flask provides utilities for testing an application. This documentation","file":"docs/testing.rst","line":4,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 116: :data:`TESTING` tells Flask that the app is in test mode. Flask changes","file":"docs/tutorial/tests.rst","line":116,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 121: :meth:`app.test_client() ` with the application","file":"docs/tutorial/tests.rst","line":121,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 821: :class:`~flask.testing.FlaskCliRunner`. The Flask app object is","file":"src/flask/app.py","line":821,"lexical":0.65,"target":false},{"text":"File: src/flask/ctx.py\nLine 268: app context if needed during setup, and :meth:`.Flask.test_request_context`","file":"src/flask/ctx.py","line":268,"lexical":0.55,"target":false},{"text":"File: src/flask/testing.py\nLine 266: \"\"\"A :class:`~click.testing.CliRunner` for testing a Flask app's","file":"src/flask/testing.py","line":266,"lexical":0.65,"target":false},{"text":"File: tests/conftest.py\nLine 29: app = Flask(\"flask_test\", root_path=os.path.dirname(__file__))","file":"tests/conftest.py","line":29,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 216: def test_robust_teardown(app: flask.Flask, client: FlaskClient) -> None:","file":"tests/test_appctx.py","line":216,"lexical":0.65,"target":false},{"text":"File: tests/test_apps/cliapp/app.py\nLine 3: testapp = Flask(\"testapp\")","file":"tests/test_apps/cliapp/app.py","line":3,"lexical":0.65,"target":false},{"text":"File: tests/test_apps/cliapp/importerrorapp.py\nLine 5: testapp = Flask(\"testapp\")","file":"tests/test_apps/cliapp/importerrorapp.py","line":5,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 237: def test_session_accessed(app: flask.Flask, client: FlaskClient) -> None:","file":"tests/test_basic.py","line":237,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 221: def test_default_static_max_age(app: flask.Flask) -> None:","file":"tests/test_blueprints.py","line":221,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 312: obj = ScriptInfo(create_app=lambda: Flask(\"testapp\"))","file":"tests/test_cli.py","line":312,"lexical":0.65,"target":true},{"text":"File: tests/test_cli.py\nLine 336: obj = ScriptInfo(create_app=lambda: Flask(\"testappgroup\"))","file":"tests/test_cli.py","line":336,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 347: def test_flaskgroup_app_context(runner):","file":"tests/test_cli.py","line":347,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 384: def test_flaskgroup_nested(app, runner):","file":"tests/test_cli.py","line":384,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 72: app.add_url_rule(url, url, lambda x=test_value: flask.jsonify(x))","file":"tests/test_json.py","line":72,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 181: app.add_url_rule(url, url, lambda: flask.jsonify(x=test_uuid))","file":"tests/test_json.py","line":181,"lexical":0.65,"target":false},{"text":"File: tests/test_logging.py\nLine 37: assert app.logger.name == \"flask_test\"","file":"tests/test_logging.py","line":37,"lexical":0.65,"target":false},{"text":"File: tests/test_reqctx.py\nLine 148: request: pytest.FixtureRequest, app: flask.Flask, client: FlaskClient","file":"tests/test_reqctx.py","line":148,"lexical":0.65,"target":false},{"text":"File: tests/test_request.py\nLine 9: def test_max_content_length(app: Flask, client: FlaskClient) -> None:","file":"tests/test_request.py","line":9,"lexical":0.65,"target":false},{"text":"File: tests/test_request.py\nLine 25: def test_limit_config(app: Flask):","file":"tests/test_request.py","line":25,"lexical":0.65,"target":false},{"text":"File: tests/test_request.py\nLine 57: def test_trusted_hosts_config(app: Flask) -> None:","file":"tests/test_request.py","line":57,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"I need to define a custom error handler for specific HTTP status codes or exception types. Please show me how to register a function that responds to these errors.","query":"register error handler","file":"src/flask/sansio/scaffold.py","symbol":"errorhandler","line":606,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 340: - Refactor ``register_error_handler`` to consolidate error checking.","file":"CHANGES.rst","line":340,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 814: - A catch-all error handler registered for ``HTTPException`` will not","file":"CHANGES.rst","line":814,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 910: - Error handling will try handlers registered for ``blueprint, code``,","file":"CHANGES.rst","line":910,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1599: - Added the ability to register application wide error handlers from","file":"CHANGES.rst","line":1599,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 401: have error handlers registered, unless the exception was raised from","file":"docs/api.rst","line":401,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 85: This can be done by registering error handlers.","file":"docs/errorhandling.rst","line":85,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 102: :meth:`~flask.Flask.register_error_handler` to register the function later.","file":"docs/errorhandling.rst","line":102,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 112: app.register_error_handler(400, handle_bad_request)","file":"docs/errorhandling.rst","line":112,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 129: app.register_error_handler(InsufficientStorage, handle_507)","file":"docs/errorhandling.rst","line":129,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 156: This can be done by registering error handlers.","file":"docs/errorhandling.rst","line":156,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 159: If no handler is registered for the code, Flask looks up the error by its class hierarchy; the most specific handler is chosen.","file":"docs/errorhandling.rst","line":159,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 165: and a handler is registered for :exc:`ConnectionError` and","file":"docs/errorhandling.rst","line":165,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 179: It is possible to register error handlers for very generic base classes","file":"docs/errorhandling.rst","line":179,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 240: When there is no error handler registered for an exception, a 500","file":"docs/errorhandling.rst","line":240,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 245: If there is an error handler registered for ``InternalServerError``,","file":"docs/errorhandling.rst","line":245,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 317: app.register_error_handler(404, page_not_found)","file":"docs/errorhandling.rst","line":317,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 371: app.register_error_handler(500, internal_server_error)","file":"docs/errorhandling.rst","line":371,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 387: # or with register_error_handler","file":"docs/errorhandling.rst","line":387,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 388: blog.register_error_handler(500, internal_server_error)","file":"docs/errorhandling.rst","line":388,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 837: registered error handlers and fall back to returning the","file":"src/flask/app.py","line":837,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 912: If an error handler is registered for ``InternalServerError`` or","file":"src/flask/app.py","line":912,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 843: :meth:`errorhandler` is registered, it will handle the exception","file":"src/flask/sansio/app.py","line":843,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 871: \"\"\"Return a registered error handler for an exception in this order:","file":"src/flask/sansio/app.py","line":871,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 110: #: A data structure of registered error handlers, in the format","file":"src/flask/sansio/scaffold.py","line":110,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/scaffold.py\nLine 118: #: To register an error handler, use the :meth:`errorhandler`","file":"src/flask/sansio/scaffold.py","line":118,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 532: :meth:`errorhandler` is registered, it will handle the exception","file":"src/flask/sansio/scaffold.py","line":532,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 630: Use :meth:`register_error_handler` instead of modifying","file":"src/flask/sansio/scaffold.py","line":630,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 644: self.register_error_handler(code_or_exception, f)","file":"src/flask/sansio/scaffold.py","line":644,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 650: def register_error_handler(","file":"src/flask/sansio/scaffold.py","line":650,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 63: blue.register_error_handler(MyFunctionException, my_function_exception_handler)","file":"tests/test_blueprints.py","line":63,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 20: app.register_error_handler(CustomException(), None)","file":"tests/test_user_error_handler.py","line":20,"lexical":0.65,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 25: app.register_error_handler(list, None)","file":"tests/test_user_error_handler.py","line":25,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Where is the generator that yields a greeting combined with a query parameter from a web request?","query":"yield flask request","file":"tests/test_helpers.py","symbol":"generate","line":232,"lang":"en","candidates":[{"text":"File: tests/test_helpers.py\nLine 234: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":234,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_helpers.py\nLine 248: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":248,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 278: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":278,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"テンプレートフィルタのテスト用エンドポイントを探して","query":"template filter test","file":"tests/test_templating.py","symbol":"index","line":234,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 144: filters, tests, and global functions for use in Jinja templates. They all follow","file":"docs/templating.rst","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 350: def test_template_filter(app):","file":"tests/test_blueprints.py","line":350,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 387: def test_add_template_filter(app):","file":"tests/test_blueprints.py","line":387,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 400: def test_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":400,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 413: def test_add_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":413,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 426: def test_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":426,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 443: def test_template_filter_after_route_with_template(app, client):","file":"tests/test_blueprints.py","line":443,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 459: def test_add_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":459,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 476: def test_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":476,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 493: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":493,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 123: def test_template_filter(app):","file":"tests/test_templating.py","line":123,"lexical":0.65,"target":true},{"text":"File: tests/test_templating.py\nLine 157: def test_add_template_filter(app):","file":"tests/test_templating.py","line":157,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 167: def test_template_filter_with_name(app):","file":"tests/test_templating.py","line":167,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 177: def test_add_template_filter_with_name(app):","file":"tests/test_templating.py","line":177,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 187: def test_template_filter_with_template(app, client):","file":"tests/test_templating.py","line":187,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 200: def test_add_template_filter_with_template(app, client):","file":"tests/test_templating.py","line":200,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 214: def test_template_filter_with_name_and_template(app, client):","file":"tests/test_templating.py","line":214,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 227: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_templating.py","line":227,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"El manejador de errores para cuando se deniega el acceso no está devolviendo la cadena de texto esperada en las pruebas.","query":"forbidden handler error","file":"tests/test_user_error_handler.py","symbol":"bp_forbidden_handler","line":173,"lang":"es","candidates":[{"text":"File: tests/test_basic.py\nLine 900: @app.errorhandler(Forbidden)","file":"tests/test_basic.py","line":900,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 993: @app.errorhandler(ForbiddenSubclass)","file":"tests/test_basic.py","line":993,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 112: @app.errorhandler(ForbiddenSubclassRegistered)","file":"tests/test_user_error_handler.py","line":112,"lexical":0.65,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 172: @bp.errorhandler(Forbidden)","file":"tests/test_user_error_handler.py","line":172,"lexical":0.65,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 193: @app.errorhandler(Forbidden)","file":"tests/test_user_error_handler.py","line":193,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm trying to extend the rendering engine with some custom logic. Where is the decorator used to register new functions as custom formatters for the HTML templates?","query":"template filter decorator","file":"src/flask/sansio/app.py","symbol":"template_filter","line":666,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1312: - Blueprints now have a decorator to add custom template filters","file":"CHANGES.rst","line":1312,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 692: def decorator(f: T_template_filter) -> T_template_filter:","file":"src/flask/sansio/app.py","line":692,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 704: The :meth:`template_filter` decorator can be used to register a function","file":"src/flask/sansio/app.py","line":704,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 469: def decorator(f: T_template_filter) -> T_template_filter:","file":"src/flask/sansio/blueprints.py","line":469,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 481: The :meth:`app_template_filter` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":481,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"where is the view that just returns the current request method?","query":"request method view","file":"tests/test_views.py","symbol":"Index","line":18,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1414: - HEAD requests to a method view now automatically dispatch to the","file":"CHANGES.rst","line":1414,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 55: The :meth:`View.dispatch_request` method is the equivalent of the view","file":"docs/views.rst","line":55,"lexical":0.65,"target":false},{"text":"File: docs/views.rst\nLine 105: ``dispatch_request`` method, as they would be for a regular view","file":"docs/views.rst","line":105,"lexical":0.65,"target":false},{"text":"File: src/flask/views.py\nLine 94: :meth:`dispatch_request` method. If the view class sets","file":"src/flask/views.py","line":94,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Wie werden die Funktionen aufgerufen, die nach einer Anfrage ausgeführt werden sollen?","query":"after request functions","file":"src/flask/app.py","symbol":"process_response","line":1397,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 400: - Relax type annotation for ``after_request`` functions. :issue:`4600`","file":"CHANGES.rst","line":400,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1524: - After request functions are now called in reverse order of","file":"CHANGES.rst","line":1524,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 141: #. Any :func:`~.after_this_request` decorated functions are called, which can modify","file":"docs/lifecycle.rst","line":141,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 143: #. Any :meth:`~.Flask.after_request` decorated functions are called, which can modify","file":"docs/lifecycle.rst","line":143,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 923: ``after_request`` functions and other finalization is done","file":"src/flask/app.py","line":923,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 1400: call all the :meth:`after_request` decorated functions.","file":"src/flask/app.py","line":1400,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1403: As of Flask 0.5 the functions registered for after request","file":"src/flask/app.py","line":1403,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1410: for func in ctx._after_request_functions:","file":"src/flask/app.py","line":1410,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 147: ctx._after_request_functions.append(f)","file":"src/flask/ctx.py","line":147,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 277: context after the request ends. However, teardown functions may already have","file":"src/flask/ctx.py","line":277,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 323: self._after_request_functions: list[ft.AfterRequestCallable[t.Any]] = []","file":"src/flask/ctx.py","line":323,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 503: ``after_request`` functions will not be called. Therefore, this","file":"src/flask/sansio/scaffold.py","line":503,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"return a hardcoded string containing forty two","query":"return \"42\"","file":"tests/test_helpers.py","symbol":"index","line":97,"lang":"en","candidates":[{"text":"File: tests/test_basic.py\nLine 882: return \"42\"","file":"tests/test_basic.py","line":882,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 980: return \"42\"","file":"tests/test_basic.py","line":980,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 98: return \"42\"","file":"tests/test_helpers.py","line":98,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_helpers.py\nLine 105: return \"42\"","file":"tests/test_helpers.py","line":105,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 126: return \"42\"","file":"tests/test_helpers.py","line":126,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 159: return \"42\"","file":"tests/test_helpers.py","line":159,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_request.py\nLine 19: return \"42\"","file":"tests/test_request.py","line":19,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Estoy revisando cómo se validan los tipos de datos antes de procesar la respuesta. ¿Podrías mostrarme la función que comprueba si un valor es de tipo binario?","query":"isinstance bytes","file":"src/flask/json/tag.py","symbol":"check","line":163,"lang":"es","candidates":[{"text":"File: src/flask/app.py\nLine 1318: if isinstance(rv, (str, bytes, bytearray)) or isinstance(rv, cabc.Iterator):","file":"src/flask/app.py","line":1318,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1358: if isinstance(status, (str, bytes, bytearray)):","file":"src/flask/app.py","line":1358,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/json/tag.py\nLine 164: return isinstance(value, bytes)","file":"src/flask/json/tag.py","line":164,"lexical":0.39999999999999997,"target":true}]} {"site":"project_search","repo":"flask","task":"フォームから送られた値をセッションに保存する処理のテストはどこにありますか?","query":"flask session form","file":"tests/test_basic.py","symbol":"do_set","line":239,"lang":"ja","candidates":[{"text":"File: docs/quickstart.rst\nLine 725: :class:`~flask.session` which allows you to store information specific to a","file":"docs/quickstart.rst","line":725,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 240: flask.session[\"value\"] = flask.request.form[\"value\"]","file":"tests/test_basic.py","line":240,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_reqctx.py\nLine 219: flask.session[\"value\"] = flask.request.form[\"value\"]","file":"tests/test_reqctx.py","line":219,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 229: flask.session[\"value\"] = flask.request.form[\"value\"]","file":"tests/test_reqctx.py","line":229,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"我想看看项目是怎么处理环境变量文件的。能不能帮我找一下那个负责从配置文件中读取变量并加载到系统环境里的逻辑?","query":"load environment variables","file":"src/flask/cli.py","symbol":"load_dotenv","line":698,"lang":"zh","candidates":[{"text":"File: docs/cli.rst\nLine 246: environment variables must be set before the app loads or it won't","file":"docs/cli.rst","line":246,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 548: instructed to load all environment variables starting with a specific","file":"docs/config.rst","line":548,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 521: \"Load environment variables from this file, taking precedence over\"","file":"src/flask/cli.py","line":521,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/cli.py\nLine 559: If installed, python-dotenv will be used to load environment variables","file":"src/flask/cli.py","line":559,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 701: \"\"\"Load \"dotenv\" files to set environment variables. A given path takes","file":"src/flask/cli.py","line":701,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/config.py\nLine 129: \"\"\"Load any environment variables that start with ``FLASK_``,","file":"src/flask/config.py","line":129,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"애플리케이션 컨텍스트가 없을 때 쿠키 최대 크기 제한 값을 가져오는 로직이 기본값으로 올바르게 동작하는지 확인해 주세요.","query":"max cookie size","file":"src/flask/wrappers.py","symbol":"max_cookie_size","line":247,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 996: - Added ``MAX_COOKIE_SIZE`` and ``Response.max_cookie_size`` to","file":"CHANGES.rst","line":996,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 385: .. py:data:: MAX_COOKIE_SIZE","file":"docs/config.rst","line":385,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 435: Added :data:`MAX_COOKIE_SIZE` to control a warning from Werkzeug.","file":"docs/config.rst","line":435,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 236: \"MAX_COOKIE_SIZE\": 4093,","file":"src/flask/app.py","line":236,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/wrappers.py\nLine 237: Added :attr:`max_cookie_size`.","file":"src/flask/wrappers.py","line":237,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/wrappers.py\nLine 247: def max_cookie_size(self) -> int: # type: ignore","file":"src/flask/wrappers.py","line":247,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/wrappers.py\nLine 248: \"\"\"Read-only view of the :data:`MAX_COOKIE_SIZE` config key.","file":"src/flask/wrappers.py","line":248,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/wrappers.py\nLine 250: See :attr:`~werkzeug.wrappers.Response.max_cookie_size` in","file":"src/flask/wrappers.py","line":250,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/wrappers.py\nLine 254: return current_app.config[\"MAX_COOKIE_SIZE\"] # type: ignore[no-any-return]","file":"src/flask/wrappers.py","line":254,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/wrappers.py\nLine 257: return super().max_cookie_size","file":"src/flask/wrappers.py","line":257,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1931: def test_max_cookie_size(app, client, recwarn):","file":"tests/test_basic.py","line":1931,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1932: app.config[\"MAX_COOKIE_SIZE\"] = 100","file":"tests/test_basic.py","line":1932,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1937: default = flask.Flask.default_config[\"MAX_COOKIE_SIZE\"]","file":"tests/test_basic.py","line":1937,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1938: assert response.max_cookie_size == default","file":"tests/test_basic.py","line":1938,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1942: assert flask.Response().max_cookie_size == 100","file":"tests/test_basic.py","line":1942,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1955: app.config[\"MAX_COOKIE_SIZE\"] = 0","file":"tests/test_basic.py","line":1955,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"O decorador que registra funções para serem executadas após todas as requisições da aplicação, e não apenas as que pertencem ao módulo atual, parece estar registrando a função de forma global no objeto principal em vez de manter o escopo local.","query":"after app request","file":"src/flask/sansio/blueprints.py","symbol":"after_app_request","line":624,"lang":"pt","candidates":[{"text":"File: docs/testing.rst\nLine 207: The app and request context will remain active *after* making a request,","file":"docs/testing.rst","line":207,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 122: same as :meth:`.Flask.after_request`, except it only applies to the current","file":"src/flask/ctx.py","line":122,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 147: ctx._after_request_functions.append(f)","file":"src/flask/ctx.py","line":147,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 403: extend(self.after_request_funcs, app.after_request_funcs)","file":"src/flask/sansio/blueprints.py","line":403,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 624: def after_app_request(self, f: T_after_request) -> T_after_request:","file":"src/flask/sansio/blueprints.py","line":624,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 629: lambda s: s.app.after_request_funcs.setdefault(None, []).append(f)","file":"src/flask/sansio/blueprints.py","line":629,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 153: ft.AppOrBlueprintKey, list[ft.AfterRequestCallable[t.Any]]","file":"src/flask/sansio/scaffold.py","line":153,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 510: execute after every request, use :meth:`.Blueprint.after_app_request`.","file":"src/flask/sansio/scaffold.py","line":510,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 512: self.after_request_funcs.setdefault(None, []).append(f)","file":"src/flask/sansio/scaffold.py","line":512,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 544: execute after every request, use :meth:`.Blueprint.teardown_app_request`.","file":"src/flask/sansio/scaffold.py","line":544,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_async.py\nLine 114: @app.after_request","file":"tests/test_async.py","line":114,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 457: @app.after_request","file":"tests/test_basic.py","line":457,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 717: @app.after_request","file":"tests/test_basic.py","line":717,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 762: def test_after_request_processing(app, client):","file":"tests/test_basic.py","line":762,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 851: def test_before_after_request_order(app, client):","file":"tests/test_basic.py","line":851,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 862: @app.after_request","file":"tests/test_basic.py","line":862,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 867: @app.after_request","file":"tests/test_basic.py","line":867,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 938: @app.after_request","file":"tests/test_basic.py","line":938,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1108: @app.after_request","file":"tests/test_basic.py","line":1108,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1707: def test_no_setup_after_first_request(app, client):","file":"tests/test_basic.py","line":1707,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 804: @bp.after_app_request","file":"tests/test_blueprints.py","line":804,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 65: @app.after_request","file":"tests/test_signals.py","line":65,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 77: flask.request_finished.connect(after_request_signal, app)","file":"tests/test_signals.py","line":77,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 92: flask.request_finished.disconnect(after_request_signal, app)","file":"tests/test_signals.py","line":92,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_app_decorators.py\nLine 9: @app.after_request","file":"tests/type_check/typing_app_decorators.py","line":9,"lexical":0.65,"target":false},{"text":"File: tests/type_check/typing_app_decorators.py\nLine 14: @app.after_request","file":"tests/type_check/typing_app_decorators.py","line":14,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"테스트 코드에서 JSON 요청 본문의 특정 필드를 사용해 인사말을 생성하는 로직을 확인하고 싶어요. 이 함수가 어떻게 동작하는지 설명해 줄 수 있나요?","query":"flask request json","file":"tests/test_testing.py","symbol":"hello","line":286,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 738: - Flask's ``JSONMixin`` for the request and response wrappers was","file":"CHANGES.rst","line":738,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1280: - Added ``flask.request.get_json()`` as a replacement for the old","file":"CHANGES.rst","line":1280,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1281: ``flask.request.json`` property.","file":"CHANGES.rst","line":1281,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 472: from flask import jsonify, request","file":"docs/errorhandling.rst","line":472,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 246: Use the :attr:`~flask.Request.json` property of the","file":"docs/patterns/javascript.rst","line":246,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 247: :data:`~flask.request` object to decode the request's body as JSON. If","file":"docs/patterns/javascript.rst","line":247,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_json.py\nLine 21: flask.request.get_json()","file":"tests/test_json.py","line":21,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 33: return flask.jsonify(foo=str(flask.request.get_json()))","file":"tests/test_json.py","line":33,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 42: return flask.request.get_json()","file":"tests/test_json.py","line":42,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 199: json = flask.request.get_json()","file":"tests/test_json.py","line":199,"lexical":0.65,"target":false},{"text":"File: tests/test_json.py\nLine 250: return flask.json.dumps(flask.request.get_json()[\"x\"])","file":"tests/test_json.py","line":250,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 268: return jsonify(flask.request.get_json())","file":"tests/test_testing.py","line":268,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_testing.py\nLine 275: assert flask.request.is_json","file":"tests/test_testing.py","line":275,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 276: assert flask.request.get_json() == json_data","file":"tests/test_testing.py","line":276,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 287: return f\"Hello, {flask.request.json['name']}!\"","file":"tests/test_testing.py","line":287,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"라우트 인자값으로 자동 옵션 요청을 비활성화하는 테스트 코드 찾아줘","query":"provide_automatic_options disable","file":"tests/test_basic.py","symbol":"test_provide_automatic_options_arg_disable","line":106,"lang":"ko","candidates":[{"text":"File: tests/test_basic.py\nLine 75: def test_provide_automatic_options_attr_disable(","file":"tests/test_basic.py","line":75,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_basic.py\nLine 106: def test_provide_automatic_options_arg_disable(","file":"tests/test_basic.py","line":106,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 119: def test_provide_automatic_options_method_disable(","file":"tests/test_basic.py","line":119,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 101: def test_view_provide_automatic_options_attr_disable(","file":"tests/test_views.py","line":101,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 136: def test_provide_automatic_options_method_disable(","file":"tests/test_views.py","line":136,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"내장된 디버거 관련 문서 어디에 있어?","query":"built-in debugger","file":"docs/debugging.rst","symbol":"The Built-In Debugger","line":23,"lang":"ko","candidates":[{"text":"File: docs/debugging.rst\nLine 8: **Do not run the development server, or enable the built-in debugger, in","file":"docs/debugging.rst","line":8,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/debugging.rst\nLine 23: The Built-In Debugger","file":"docs/debugging.rst","line":23,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/debugging.rst\nLine 26: The built-in Werkzeug development server provides a debugger which shows","file":"docs/debugging.rst","line":26,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/debugging.rst\nLine 64: powerful debugging experience than the built-in debugger. They can also","file":"docs/debugging.rst","line":64,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/debugging.rst\nLine 70: turns unhandled errors into generic 500 error pages. However, the built-in debugger and","file":"docs/debugging.rst","line":70,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/debugging.rst\nLine 86: - If the built-in debugger is not disabled, it will catch unhandled exceptions before","file":"docs/debugging.rst","line":86,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/index.rst\nLine 6: using the built-in development server, debugger, and reloader. These","file":"docs/deploying/index.rst","line":6,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 122: - :doc:`/debugging` for information about using the built-in debugger","file":"docs/quickstart.rst","line":122,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"How do I implement a way to display temporary notification messages to the user?","query":"message flashing","file":"docs/patterns/flashing.rst","symbol":"Message Flashing","line":1,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1260: - Added ``message_flashed`` signal that simplifies flashing testing.","file":"CHANGES.rst","line":1260,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1347: message flashing on sessions implementations which use external","file":"CHANGES.rst","line":1347,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 212: Message Flashing","file":"docs/api.rst","line":212,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 498: This signal is sent when the application is flashing a message. The","file":"docs/api.rst","line":498,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 1: Message Flashing","file":"docs/patterns/flashing.rst","line":1,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/patterns/flashing.rst\nLine 11: a limit on cookie sizes. This means that flashing messages that are too","file":"docs/patterns/flashing.rst","line":11,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 12: large for session cookies causes message flashing to fail silently.","file":"docs/patterns/flashing.rst","line":12,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 96: It is also possible to provide categories when flashing a message. The","file":"docs/patterns/flashing.rst","line":96,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/quickstart.rst\nLine 783: Message Flashing","file":"docs/quickstart.rst","line":783,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"implémenter la méthode pour retirer le contexte actif et exécuter les fonctions de teardown","query":"context teardown pop","file":"src/flask/ctx.py","symbol":"pop","line":446,"lang":"fr","candidates":[{"text":"File: docs/appcontext.rst\nLine 162: The teardown callbacks are called by the context when it is popped. They are","file":"docs/appcontext.rst","line":162,"lexical":0.65,"target":false},{"text":"File: src/flask/ctx.py\nLine 271: When the context is popped, it will evaluate all the teardown functions","file":"src/flask/ctx.py","line":271,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"Flaskのビュー関数内で、非同期関数を同期的に実行しようとする際に、アプリケーションコンテキストの整合性が保たれず、実行時にエラーが発生する可能性がある挙動を修正してください。","query":"ensure_sync dispatch_request","file":"src/flask/views.py","symbol":"view","line":115,"lang":"ja","candidates":[{"text":"File: src/flask/views.py\nLine 110: return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]","file":"src/flask/views.py","line":110,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/views.py\nLine 116: return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]","file":"src/flask/views.py","line":116,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"check if creating a web application instance triggers any module loading errors","query":"flask import error","file":"tests/test_helpers.py","symbol":"TestNoImports","line":209,"lang":"en","candidates":[{"text":"File: tests/test_basic.py\nLine 1130: from flask.debughelpers import DebugFilesKeyError","file":"tests/test_basic.py","line":1130,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 212: Avoiding ``__import__`` helps create Flask instances where there are errors","file":"tests/test_helpers.py","line":212,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_helpers.py\nLine 223: flask.Flask(\"importerror\")","file":"tests/test_helpers.py","line":223,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 225: AssertionError(\"Flask(import_name) is importing import_name.\")","file":"tests/test_helpers.py","line":225,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 9: from flask.logging import wsgi_errors_stream","file":"tests/test_logging.py","line":9,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"我需要为模板环境注册一个全局可用的函数。请帮我找到定义如何在Flask应用中添加这种全局模板函数的方法。","query":"add template global","file":"src/flask/sansio/app.py","symbol":"template_global","line":773,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 1214: - Added ``template_global`` methods in addition to the already","file":"CHANGES.rst","line":1214,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 181: :meth:`~.Flask.add_template_test` method. For template global functions, use the","file":"docs/templating.rst","line":181,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 182: :meth:`~.Flask.template_global` decorator or :meth:`~.Flask.add_template_global`","file":"docs/templating.rst","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 791: The :meth:`add_template_global` method may be used to register a","file":"src/flask/sansio/app.py","line":791,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 800: self.add_template_global(name)","file":"src/flask/sansio/app.py","line":800,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 804: self.add_template_global(f, name=name)","file":"src/flask/sansio/app.py","line":804,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 810: def add_template_global(","file":"src/flask/sansio/app.py","line":810,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 568: The :meth:`add_app_template_global` method may be used to register a","file":"src/flask/sansio/blueprints.py","line":568,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 580: self.add_app_template_global(name)","file":"src/flask/sansio/blueprints.py","line":580,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 584: self.add_app_template_global(f, name=name)","file":"src/flask/sansio/blueprints.py","line":584,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 590: def add_app_template_global(","file":"src/flask/sansio/blueprints.py","line":590,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 599: blueprint. Equivalent to :meth:`.Flask.add_template_global`.","file":"src/flask/sansio/blueprints.py","line":599,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 609: state.app.add_template_global(f, name=name)","file":"src/flask/sansio/blueprints.py","line":609,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 359: def test_add_template_global(app, app_ctx):","file":"tests/test_templating.py","line":359,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Se está lanzando una excepción de clave inexistente de forma manual dentro de las pruebas de validación de errores de usuario, lo cual parece ser un caso de prueba para verificar el manejo de fallos.","query":"raise KeyError test","file":"tests/test_user_error_handler.py","symbol":"do_error","line":230,"lang":"es","candidates":[{"text":"File: tests/test_appctx.py\nLine 153: with pytest.raises(KeyError):","file":"tests/test_appctx.py","line":153,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1075: with pytest.raises(KeyError) as exc_info:","file":"tests/test_basic.py","line":1075,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1138: with pytest.raises(DebugFilesKeyError) as e:","file":"tests/test_basic.py","line":1138,"lexical":0.65,"target":false},{"text":"File: tests/test_json_tag.py\nLine 37: pytest.raises(KeyError, s.register, TagDict)","file":"tests/test_json_tag.py","line":37,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Je cherche à voir comment on gère les requêtes sur la page d'accueil dans les tests. Est-ce qu'il y a une vue qui renvoie simplement le type de méthode HTTP utilisée ?","query":"flask view method","file":"tests/test_views.py","symbol":"Index","line":185,"lang":"fr","candidates":[{"text":"File: docs/api.rst\nLine 524: .. autoclass:: flask.views.MethodView","file":"docs/api.rst","line":524,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 654: Flask will look on the view function object itself if a `methods`","file":"docs/api.rst","line":654,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/async-await.rst\nLine 22: method in views that inherit from the :class:`flask.views.View` class, as","file":"docs/async-await.rst","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/async-await.rst\nLine 24: :class:`flask.views.MethodView` class.","file":"docs/async-await.rst","line":24,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 246: from flask.views import MethodView","file":"docs/views.rst","line":246,"lexical":0.65,"target":false},{"text":"File: tests/test_async.py\nLine 8: from flask.views import MethodView","file":"tests/test_async.py","line":8,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 136: from flask.views import MethodView","file":"tests/test_helpers.py","line":136,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 152: assert flask.url_for(\"myview\", _method=\"GET\") == \"/myview/\"","file":"tests/test_helpers.py","line":152,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 153: assert flask.url_for(\"myview\", id=42, _method=\"GET\") == \"/myview/42\"","file":"tests/test_helpers.py","line":153,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 154: assert flask.url_for(\"myview\", _method=\"POST\") == \"/myview/create\"","file":"tests/test_helpers.py","line":154,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_views.py\nLine 29: class Index(flask.views.MethodView):","file":"tests/test_views.py","line":29,"lexical":0.65,"target":true},{"text":"File: tests/test_views.py\nLine 42: class Index(flask.views.MethodView):","file":"tests/test_views.py","line":42,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 63: class Index(flask.views.MethodView):","file":"tests/test_views.py","line":63,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 153: class Index(flask.views.MethodView):","file":"tests/test_views.py","line":153,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 167: class Index(flask.views.MethodView):","file":"tests/test_views.py","line":167,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 201: class BaseView(flask.views.MethodView):","file":"tests/test_views.py","line":201,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 219: class GetView(flask.views.MethodView):","file":"tests/test_views.py","line":219,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 223: class DeleteView(flask.views.MethodView):","file":"tests/test_views.py","line":223,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 238: class GetView(flask.views.MethodView):","file":"tests/test_views.py","line":238,"lexical":0.65,"target":false},{"text":"File: tests/test_views.py\nLine 242: class OtherView(flask.views.MethodView):","file":"tests/test_views.py","line":242,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"指定したモジュール名からアプリのインスタンスを探す処理を見つけて","query":"import flask app","file":"src/flask/cli.py","symbol":"locate_app","line":230,"lang":"ja","candidates":[{"text":"File: docs/api.rst\nLine 453: from flask import appcontext_tearing_down","file":"docs/api.rst","line":453,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 469: from flask import appcontext_pushed","file":"docs/api.rst","line":469,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 346: from flask.cli import AppGroup","file":"docs/cli.rst","line":346,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 434: from flask.cli import with_appcontext","file":"docs/cli.rst","line":434,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 547: debug mode. ``--app hello`` should be the import or file with your Flask app.","file":"docs/cli.rst","line":547,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 46: from flask import current_app, Blueprint, render_template","file":"docs/patterns/appfactories.rst","line":46,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 43: from flask import current_app, g","file":"docs/tutorial/database.rst","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 95: ``--app`` like ``flask run`` does. You need to tell it to import and","file":"docs/tutorial/deploy.rst","line":95,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 74: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":74,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 150: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":150,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/db.py\nLine 5: from flask import current_app","file":"examples/tutorial/flaskr/db.py","line":5,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 6: from flaskr import create_app","file":"examples/tutorial/tests/conftest.py","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_factory.py\nLine 1: from flaskr import create_app","file":"examples/tutorial/tests/test_factory.py","line":1,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/__init__.py\nLine 2: from .app import Flask as Flask","file":"src/flask/__init__.py","line":2,"lexical":0.55,"target":false},{"text":"File: src/flask/app.py\nLine 150: import name of your application. For example the Flask-SQLAlchemy","file":"src/flask/app.py","line":150,"lexical":0.65,"target":false},{"text":"File: src/flask/cli.py\nLine 34: from .app import Flask","file":"src/flask/cli.py","line":34,"lexical":0.55,"target":true},{"text":"File: src/flask/cli.py\nLine 312: #: Optionally the import path for the Flask application.","file":"src/flask/cli.py","line":312,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 774: click.echo(f\" * Serving Flask app '{app_import_path}'\")","file":"src/flask/cli.py","line":774,"lexical":0.55,"target":false},{"text":"File: src/flask/ctx.py\nLine 21: from .app import Flask","file":"src/flask/ctx.py","line":21,"lexical":0.55,"target":false},{"text":"File: src/flask/ctx.py\nLine 241: from flask import has_app_context, g","file":"src/flask/ctx.py","line":241,"lexical":0.55,"target":false},{"text":"File: src/flask/globals.py\nLine 9: from .app import Flask","file":"src/flask/globals.py","line":9,"lexical":0.55,"target":false},{"text":"File: src/flask/logging.py\nLine 62: :attr:`app.import_name `.","file":"src/flask/logging.py","line":62,"lexical":0.55,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 99: import name of your application. For example the Flask-SQLAlchemy","file":"src/flask/sansio/app.py","line":99,"lexical":0.65,"target":false},{"text":"File: src/flask/sessions.py\nLine 19: from .app import Flask","file":"src/flask/sessions.py","line":19,"lexical":0.55,"target":false},{"text":"File: src/flask/testing.py\nLine 24: from .app import Flask","file":"src/flask/testing.py","line":24,"lexical":0.55,"target":false},{"text":"File: tests/conftest.py\nLine 7: from flask.globals import app_ctx as _app_ctx","file":"tests/conftest.py","line":7,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 6: from flask.globals import app_ctx","file":"tests/test_appctx.py","line":6,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 24: from flask.globals import app_ctx","file":"tests/test_basic.py","line":24,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 17: from flask import current_app","file":"tests/test_cli.py","line":17,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 19: from flask.cli import AppGroup","file":"tests/test_cli.py","line":19,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 20: from flask.cli import find_best_app","file":"tests/test_cli.py","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 24: from flask.cli import locate_app","file":"tests/test_cli.py","line":24,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"encontra a função que retorna a saudação inicial","query":"hello world","file":"examples/tutorial/flaskr/__init__.py","symbol":"hello","line":27,"lang":"pt","candidates":[{"text":"File: README.md\nLine 30: return \"Hello, World!\"","file":"README.md","line":30,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 674: return 'Hello World!'","file":"docs/api.rst","line":674,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/design.rst\nLine 26: return 'Hello World!'","file":"docs/design.rst","line":26,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/design.rst\nLine 34: return 'Hello World!'","file":"docs/design.rst","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/gevent.rst\nLine 96: return f\"Hello, {request.args.get(\"name\", \"World\")}!\"","file":"docs/gevent.rst","line":96,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 29: return \"Hello, World!\"","file":"docs/lifecycle.rst","line":29,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 32: def hello_world():","file":"docs/patterns/appdispatch.rst","line":32,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 33: return 'Hello World!'","file":"docs/patterns/appdispatch.rst","line":33,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/packages.rst\nLine 99: return 'Hello World!'","file":"docs/patterns/packages.rst","line":99,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 171: return \"Hello world\"","file":"docs/patterns/viewdecorators.rst","line":171,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 20: def hello_world():","file":"docs/quickstart.rst","line":20,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 21: return \"

Hello, World!

\"","file":"docs/quickstart.rst","line":21,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 169: return 'Hello, World'","file":"docs/quickstart.rst","line":169,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 408:

Hello, World!

","file":"docs/quickstart.rst","line":408,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 108: assert b\"

Hello, World!

\" in response.data","file":"docs/testing.rst","line":108,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 12: how the \"Hello, World!\" example did on the previous page. While this is","file":"docs/tutorial/factory.rst","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 64: return 'Hello, World!'","file":"docs/tutorial/factory.rst","line":64,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 118: function that returns a response, the string ``'Hello, World!'`` in","file":"docs/tutorial/factory.rst","line":118,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 151: \"Hello, World!\" message. Congratulations, you're now running your Flask","file":"docs/tutorial/factory.rst","line":151,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/layout.rst\nLine 32: return 'Hello, World!'","file":"docs/tutorial/layout.rst","line":32,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 160: assert response.data == b'Hello, World!'","file":"docs/tutorial/tests.rst","line":160,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 163: the beginning of the tutorial. It returns \"Hello, World!\", so the test","file":"docs/tutorial/tests.rst","line":163,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 298: ``url_for('hello', who='World')``.","file":"docs/tutorial/views.rst","line":298,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 28: return \"Hello, World!\"","file":"examples/tutorial/flaskr/__init__.py","line":28,"lexical":0.39999999999999997,"target":true},{"text":"File: examples/tutorial/tests/test_factory.py\nLine 12: assert response.data == b\"Hello, World!\"","file":"examples/tutorial/tests/test_factory.py","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/ctx.py\nLine 135: return \"Hello, World!\"","file":"src/flask/ctx.py","line":135,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 316: return hello('World')","file":"src/flask/helpers.py","line":316,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 353: return \"Hello, World!\"","file":"src/flask/sansio/scaffold.py","line":353,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/static/index.html\nLine 1:

Hello World!

","file":"tests/static/index.html","line":1,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 149: flask.g.setdefault(\"bar\", \"hello world\")","file":"tests/test_appctx.py","line":149,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_apps/helloworld/hello.py\nLine 8: return \"Hello World!\"","file":"tests/test_apps/helloworld/hello.py","line":8,"lexical":0.6000000000000001,"target":false},{"text":"File: tests/test_basic.py\nLine 36: return \"Hello World\"","file":"tests/test_basic.py","line":36,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"我在测试子类的异常处理逻辑,需要一个简单的函数来触发异常。请帮我写一个测试用的函数,它直接抛出一个通用异常。","query":"test exception raise","file":"tests/test_subclassing.py","symbol":"index","line":15,"lang":"zh","candidates":[{"text":"File: tests/test_appctx.py\nLine 250: with pytest.raises(ExceptionGroup, match=\"context teardown\") as exc_info: # noqa: F821","file":"tests/test_appctx.py","line":250,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 111: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":111,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 117: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":117,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 124: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":124,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 217: with pytest.raises(NoAppException):","file":"tests/test_cli.py","line":217,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 226: with pytest.raises(NoAppException):","file":"tests/test_cli.py","line":226,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 273: pytest.raises(NoAppException, obj.load_app)","file":"tests/test_cli.py","line":273,"lexical":0.65,"target":false},{"text":"File: tests/test_helpers.py\nLine 181: with pytest.raises(werkzeug.exceptions.Unauthorized):","file":"tests/test_helpers.py","line":181,"lexical":0.65,"target":false},{"text":"File: tests/test_logging.py\nLine 89: raise Exception(\"test\")","file":"tests/test_logging.py","line":89,"lexical":0.65,"target":false},{"text":"File: tests/test_subclassing.py\nLine 16: raise Exception(\"test\")","file":"tests/test_subclassing.py","line":16,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"投稿を削除して一覧へリダイレクトする処理を探して","query":"delete post","file":"examples/tutorial/flaskr/blog.py","symbol":"delete","line":115,"lang":"ja","candidates":[{"text":"File: docs/tutorial/blog.rst\nLine 9: author of a post to edit or delete it.","file":"docs/tutorial/blog.rst","line":9,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 193: Both the ``update`` and ``delete`` views will need to fetch a ``post``","file":"docs/tutorial/blog.rst","line":193,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 293:
","file":"docs/tutorial/blog.rst","line":293,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 300: and specifies an ``action`` attribute that posts to the delete view","file":"docs/tutorial/blog.rst","line":300,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 316: of ``update.html`` and posts to the ``//delete`` URL. Since there","file":"docs/tutorial/blog.rst","line":316,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 323: @bp.route('//delete', methods=('POST',))","file":"docs/tutorial/blog.rst","line":323,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 328: db.execute('DELETE FROM post WHERE id = ?', (id,))","file":"docs/tutorial/blog.rst","line":328,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/index.rst\nLine 22: and edit or delete their own posts. You will be able to package and","file":"docs/tutorial/index.rst","line":22,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 392: ``delete`` views. The logged in user must be the author of the post to","file":"docs/tutorial/tests.rst","line":392,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 420: assert client.post('/1/delete').status_code == 403","file":"docs/tutorial/tests.rst","line":420,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 473: The ``delete`` view should redirect to the index URL and the post should","file":"docs/tutorial/tests.rst","line":473,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 481: response = client.post('/1/delete')","file":"docs/tutorial/tests.rst","line":481,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/blog.py\nLine 113: @bp.route(\"//delete\", methods=(\"POST\",))","file":"examples/tutorial/flaskr/blog.py","line":113,"lexical":0.39999999999999997,"target":true},{"text":"File: examples/tutorial/flaskr/blog.py\nLine 116: \"\"\"Delete a post.","file":"examples/tutorial/flaskr/blog.py","line":116,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/blog.py\nLine 123: db.execute(\"DELETE FROM post WHERE id = ?\", (id,))","file":"examples/tutorial/flaskr/blog.py","line":123,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/templates/blog/update.html\nLine 16: ","file":"examples/tutorial/flaskr/templates/blog/update.html","line":16,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/tests/test_blog.py\nLine 35: assert client.post(\"/1/delete\").status_code == 403","file":"examples/tutorial/tests/test_blog.py","line":35,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/tests/test_blog.py\nLine 77: response = client.post(\"/1/delete\")","file":"examples/tutorial/tests/test_blog.py","line":77,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/views.py\nLine 12: [\"get\", \"query\", \"post\", \"head\", \"options\", \"delete\", \"put\", \"trace\", \"patch\"]","file":"src/flask/views.py","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 56: @pytest.mark.parametrize(\"method\", [\"get\", \"query\", \"post\", \"put\", \"delete\", \"patch\"])","file":"tests/test_basic.py","line":56,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 77: assert meths == {\"DELETE\", \"GET\", \"HEAD\", \"OPTIONS\", \"POST\"}","file":"tests/test_views.py","line":77,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"flaskアプリのインスタンスを作成するクラスを探す","query":"flask application instance","file":"tests/test_cli.py","symbol":"Module","line":53,"lang":"ja","candidates":[{"text":"File: docs/design.rst\nLine 15: instance of the :class:`~flask.Flask` class. Each Flask application has","file":"docs/design.rst","line":15,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 14: Flask application is an instance of the :class:`.Flask` class, which collects all","file":"docs/lifecycle.rst","line":14,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 6: A Flask application is an instance of the :class:`Flask` class.","file":"docs/tutorial/factory.rst","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 7: \"\"\"Create and configure an instance of the Flask application.\"\"\"","file":"examples/tutorial/flaskr/__init__.py","line":7,"lexical":0.55,"target":false}]} {"site":"project_search","repo":"flask","task":"모든 뷰에서 템플릿 변수를 사용할 수 있게 등록하는 데코레이터가 어디에 정의되어 있는지 찾아줘. 블루프린트 단위가 아니라 앱 전체에 적용되는 방식이어야 해.","query":"template context processor","file":"src/flask/sansio/blueprints.py","symbol":"app_context_processor","line":644,"lang":"ko","candidates":[{"text":"File: docs/templating.rst\nLine 199: template context. A context processor is a function that returns a","file":"docs/templating.rst","line":199,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 596: context as well as everything template context processors want","file":"src/flask/app.py","line":596,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 615: if name in self.template_context_processors:","file":"src/flask/app.py","line":615,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 616: for func in self.template_context_processors[name]:","file":"src/flask/app.py","line":616,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 22: T_template_context_processor = t.TypeVar(","file":"src/flask/sansio/blueprints.py","line":22,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 23: \"T_template_context_processor\", bound=ft.TemplateContextProcessorCallable","file":"src/flask/sansio/blueprints.py","line":23,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 410: extend(self.template_context_processors, app.template_context_processors)","file":"src/flask/sansio/blueprints.py","line":410,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 645: self, f: T_template_context_processor","file":"src/flask/sansio/blueprints.py","line":645,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 646: ) -> T_template_context_processor:","file":"src/flask/sansio/blueprints.py","line":646,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 647: \"\"\"Like :meth:`context_processor`, but for templates rendered by every view, not","file":"src/flask/sansio/blueprints.py","line":647,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 651: lambda s: s.app.template_context_processors.setdefault(None, []).append(f)","file":"src/flask/sansio/blueprints.py","line":651,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 32: T_template_context_processor = t.TypeVar(","file":"src/flask/sansio/scaffold.py","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 33: \"T_template_context_processor\", bound=ft.TemplateContextProcessorCallable","file":"src/flask/sansio/scaffold.py","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 182: self.template_context_processors: dict[","file":"src/flask/sansio/scaffold.py","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 183: ft.AppOrBlueprintKey, list[ft.TemplateContextProcessorCallable]","file":"src/flask/sansio/scaffold.py","line":183,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 552: f: T_template_context_processor,","file":"src/flask/sansio/scaffold.py","line":552,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 553: ) -> T_template_context_processor:","file":"src/flask/sansio/scaffold.py","line":553,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 554: \"\"\"Registers a template context processor function. These functions run before","file":"src/flask/sansio/scaffold.py","line":554,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 561: and affect every template, use :meth:`.Blueprint.app_context_processor`.","file":"src/flask/sansio/scaffold.py","line":561,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 563: self.template_context_processors[None].append(f)","file":"src/flask/sansio/scaffold.py","line":563,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/templating.py\nLine 22: \"\"\"Default template context processor. Replaces the ``request`` and ``g``","file":"src/flask/templating.py","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/typing.py\nLine 64: TemplateContextProcessorCallable = (","file":"src/flask/typing.py","line":64,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Comment sérialiser un objet en chaîne JSON en utilisant les options par défaut de l'instance ?","query":"serialize json string","file":"src/flask/json/provider.py","symbol":"dumps","line":166,"lang":"fr","candidates":[{"text":"File: src/flask/json/provider.py\nLine 167: \"\"\"Serialize data as JSON to a string.","file":"src/flask/json/provider.py","line":167,"lexical":0.55,"target":true},{"text":"File: src/flask/json/provider.py\nLine 182: \"\"\"Deserialize data as JSON from a string or bytes.","file":"src/flask/json/provider.py","line":182,"lexical":0.55,"target":false},{"text":"File: src/flask/json/tag.py\nLine 326: \"\"\"Load data from a JSON string and deserialized any tagged objects.\"\"\"","file":"src/flask/json/tag.py","line":326,"lexical":0.55,"target":false},{"text":"File: src/flask/testing.py\nLine 89: \"\"\"Serialize ``obj`` to a JSON-formatted string.","file":"src/flask/testing.py","line":89,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"find the helper that builds a response to send a user to a different url","query":"redirect response","file":"src/flask/helpers.py","symbol":"redirect","line":254,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 480: - From Werkzeug, for redirect responses the ``Location`` header URL","file":"CHANGES.rst","line":480,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 163: A response might be a redirect, for example if you logged in with","file":"docs/patterns/javascript.rst","line":163,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 167: inspect the response and apply the redirect manually.","file":"docs/patterns/javascript.rst","line":167,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 173: if (response.redirected) {","file":"docs/patterns/javascript.rst","line":173,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 184: the client will continue to make requests until a non-redirect response","file":"docs/testing.rst","line":184,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 195: response = client.get(\"/logout\", follow_redirects=True)","file":"docs/testing.rst","line":195,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 196: # Check that there was one redirect response.","file":"docs/testing.rst","line":196,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 152: it. :func:`redirect` generates a redirect response to the generated","file":"docs/tutorial/views.rst","line":152,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 257: \"\"\"Create a redirect response object.","file":"src/flask/helpers.py","line":257,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/helpers.py\nLine 278: return _wz_redirect(location, code=code, Response=Response)","file":"src/flask/helpers.py","line":278,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 939: def redirect(self, location: str, code: int = 303) -> BaseResponse:","file":"src/flask/sansio/app.py","line":939,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 940: \"\"\"Create a redirect response object.","file":"src/flask/sansio/app.py","line":940,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 165: response = flask.redirect(\"https://localhost\", 307)","file":"tests/test_helpers.py","line":165,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Wie wird der Wert aus der Flask-Sitzung als String zurückgegeben?","query":"flask session value","file":"tests/test_testing.py","symbol":"index","line":179,"lang":"de","candidates":[{"text":"File: docs/quickstart.rst\nLine 773: A note on cookie-based sessions: Flask will take the values you put into the","file":"docs/quickstart.rst","line":773,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 240: flask.session[\"value\"] = flask.request.form[\"value\"]","file":"tests/test_basic.py","line":240,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 245: return flask.session.get(\"value\", \"None\")","file":"tests/test_basic.py","line":245,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 219: flask.session[\"value\"] = flask.request.form[\"value\"]","file":"tests/test_reqctx.py","line":219,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 224: v = flask.session.get(\"value\", \"None\")","file":"tests/test_reqctx.py","line":224,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 229: flask.session[\"value\"] = flask.request.form[\"value\"]","file":"tests/test_reqctx.py","line":229,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 234: v = flask.session.get(\"value\", \"None\")","file":"tests/test_reqctx.py","line":234,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 180: return str(flask.session.get(\"value\"))","file":"tests/test_testing.py","line":180,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"¿Dónde se instancia la aplicación de Flask para las pruebas?","query":"Flask app instance","file":"tests/test_cli.py","symbol":"make_app","line":83,"lang":"es","candidates":[{"text":"File: docs/api.rst\nLine 157: app context. An instance of :attr:`.Flask.app_ctx_globals_class`, which","file":"docs/api.rst","line":157,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 48: Uses the ``app2`` Flask instance in ``hello``.","file":"docs/cli.rst","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 783: app = Flask(__name__, instance_path='/path/to/instance/folder')","file":"docs/config.rst","line":783,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 817: app = Flask(__name__, instance_relative_config=True)","file":"docs/config.rst","line":817,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 823: app = Flask(__name__, instance_relative_config=True)","file":"docs/config.rst","line":823,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/design.rst\nLine 15: instance of the :class:`~flask.Flask` class. Each Flask application has","file":"docs/design.rst","line":15,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 14: Flask application is an instance of the :class:`.Flask` class, which collects all","file":"docs/lifecycle.rst","line":14,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 144: means that the decorated tasks are tied to the specific Flask and Celery app instances,","file":"docs/patterns/celery.rst","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 6: A Flask application is an instance of the :class:`Flask` class.","file":"docs/tutorial/factory.rst","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 45: app = Flask(__name__, instance_relative_config=True)","file":"docs/tutorial/factory.rst","line":45,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 48: DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),","file":"docs/tutorial/factory.rst","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 71: #. ``app = Flask(__name__, instance_relative_config=True)`` creates the","file":"docs/tutorial/factory.rst","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 95: :attr:`app.instance_path `, which is the","file":"docs/tutorial/factory.rst","line":95,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 110: :attr:`app.instance_path ` exists. Flask","file":"docs/tutorial/factory.rst","line":110,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 7: \"\"\"Create and configure an instance of the Flask application.\"\"\"","file":"examples/tutorial/flaskr/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 8: app = Flask(__name__, instance_relative_config=True)","file":"examples/tutorial/flaskr/__init__.py","line":8,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 13: DATABASE=os.path.join(app.instance_path, \"flaskr.sqlite\"),","file":"examples/tutorial/flaskr/__init__.py","line":13,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 51: if isinstance(app, Flask):","file":"src/flask/cli.py","line":51,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 74: if isinstance(app, Flask):","file":"src/flask/cli.py","line":74,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 191: if isinstance(app, Flask):","file":"src/flask/cli.py","line":191,"lexical":0.55,"target":false},{"text":"File: src/flask/json/provider.py\nLine 30: :attr:`app.json ` to an instance of the class.","file":"src/flask/json/provider.py","line":30,"lexical":0.55,"target":false},{"text":"File: tests/test_cli.py\nLine 69: assert isinstance(app, Flask)","file":"tests/test_cli.py","line":69,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_cli.py\nLine 78: assert isinstance(app, Flask)","file":"tests/test_cli.py","line":78,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 87: assert isinstance(app, Flask)","file":"tests/test_cli.py","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_instance_config.py\nLine 12: app = flask.Flask(__name__, instance_path=os.fspath(modules_tmp_path))","file":"tests/test_instance_config.py","line":12,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"플라스크 뷰의 현재 엔드포인트 이름을 추출하는 테스트 케이스를 작성하려고 합니다. 요청 컨텍스트에서 엔드포인트 정보를 반환하는 함수를 구현해 주세요.","query":"flask request endpoint","file":"tests/test_blueprints.py","symbol":"foo_bar_foo","line":295,"lang":"ko","candidates":[{"text":"File: tests/test_basic.py\nLine 1747: return flask.request.endpoint","file":"tests/test_basic.py","line":1747,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1751: return flask.request.endpoint","file":"tests/test_basic.py","line":1751,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1755: return flask.request.endpoint","file":"tests/test_basic.py","line":1755,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 288: return flask.request.endpoint","file":"tests/test_blueprints.py","line":288,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 292: return flask.request.endpoint","file":"tests/test_blueprints.py","line":292,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 296: return flask.request.endpoint","file":"tests/test_blueprints.py","line":296,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 300: return flask.request.endpoint","file":"tests/test_blueprints.py","line":300,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 306: return flask.request.endpoint","file":"tests/test_blueprints.py","line":306,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 342: return flask.request.endpoint","file":"tests/test_blueprints.py","line":342,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1092: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1092,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1104: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1104,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"añade una excepción al búfer al terminar una petición","query":"append exception buffer","file":"tests/test_reqctx.py","symbol":"end_of_request","line":33,"lang":"es","candidates":[{"text":"File: tests/test_reqctx.py\nLine 20: buffer.append(exception)","file":"tests/test_reqctx.py","line":20,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_reqctx.py\nLine 34: buffer.append(exception)","file":"tests/test_reqctx.py","line":34,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 51: buffer.append(exception)","file":"tests/test_reqctx.py","line":51,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Flask 앱에서 루트 경로 기준 리소스 파일을 읽기 위해 열 때 사용하는 함수가 어떻게 구현되어 있는지 확인하고 싶어요. 특히 스키마 SQL 파일을 읽어오기 위해 이 함수를 호출하는 예시가 궁금합니다.","query":"open resource file","file":"src/flask/app.py","symbol":"open_resource","line":415,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 731: - ``open_resource`` accepts the \"rt\" file mode. This still does the","file":"CHANGES.rst","line":731,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 829: file from the instance folder with :meth:`Flask.open_instance_resource`.","file":"docs/config.rst","line":829,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 141: :meth:`open_resource() ` opens a file relative to","file":"docs/tutorial/database.rst","line":141,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 418: \"\"\"Open a resource file relative to :attr:`root_path` for reading.","file":"src/flask/app.py","line":418,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 451: \"\"\"Open a resource file relative to the application's instance folder","file":"src/flask/app.py","line":451,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 452: :attr:`instance_path`. Unlike :meth:`open_resource`, files in the","file":"src/flask/app.py","line":452,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 107: \"\"\"Open a resource file relative to :attr:`root_path` for reading. The","file":"src/flask/blueprints.py","line":107,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"como essa função lida com a execução de métodos assíncronos dentro de uma rota?","query":"ensure_sync dispatch_request","file":"src/flask/views.py","symbol":"view","line":106,"lang":"pt","candidates":[{"text":"File: src/flask/views.py\nLine 110: return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]","file":"src/flask/views.py","line":110,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/views.py\nLine 116: return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]","file":"src/flask/views.py","line":116,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Peux-tu me montrer la fonction qui vérifie si le nom du modèle correspond bien au nom attendu dans les tests JavaScript ?","query":"template name assert","file":"examples/javascript/tests/test_js_example.py","symbol":"check","line":15,"lang":"fr","candidates":[{"text":"File: docs/signals.rst\nLine 66: assert template.name == 'index.html'","file":"docs/signals.rst","line":66,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/javascript/tests/test_js_example.py\nLine 16: assert template.name == template_name","file":"examples/javascript/tests/test_js_example.py","line":16,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_signals.py\nLine 19: assert template.name == \"simple_template.html\"","file":"tests/test_signals.py","line":19,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 43: assert template.name == \"simple_template.html\"","file":"tests/test_signals.py","line":43,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"设置测试用的应用配置并返回应用实例","query":"test app fixture","file":"examples/javascript/tests/conftest.py","symbol":"fixture_app","line":7,"lang":"zh","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 63: The ``app`` fixture will call the factory and pass ``test_config`` to","file":"docs/tutorial/tests.rst","line":63,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 122: object created by the ``app`` fixture. Tests will use the client to make","file":"docs/tutorial/tests.rst","line":122,"lexical":0.65,"target":false},{"text":"File: examples/javascript/tests/conftest.py\nLine 6: @pytest.fixture(name=\"app\")","file":"examples/javascript/tests/conftest.py","line":6,"lexical":0.65,"target":true},{"text":"File: tests/test_async.py\nLine 40: @pytest.fixture(name=\"async_app\")","file":"tests/test_async.py","line":40,"lexical":0.65,"target":false},{"text":"File: tests/test_reqctx.py\nLine 148: request: pytest.FixtureRequest, app: flask.Flask, client: FlaskClient","file":"tests/test_reqctx.py","line":148,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"encontre a função de teste que lança uma exceção genérica","query":"raise Exception test","file":"tests/test_logging.py","symbol":"index","line":88,"lang":"pt","candidates":[{"text":"File: tests/test_appctx.py\nLine 250: with pytest.raises(ExceptionGroup, match=\"context teardown\") as exc_info: # noqa: F821","file":"tests/test_appctx.py","line":250,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 111: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":111,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 117: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":117,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 124: pytest.raises(NoAppException, find_best_app, Module)","file":"tests/test_cli.py","line":124,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 217: with pytest.raises(NoAppException):","file":"tests/test_cli.py","line":217,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 226: with pytest.raises(NoAppException):","file":"tests/test_cli.py","line":226,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 273: pytest.raises(NoAppException, obj.load_app)","file":"tests/test_cli.py","line":273,"lexical":0.65,"target":false},{"text":"File: tests/test_helpers.py\nLine 181: with pytest.raises(werkzeug.exceptions.Unauthorized):","file":"tests/test_helpers.py","line":181,"lexical":0.65,"target":false},{"text":"File: tests/test_logging.py\nLine 89: raise Exception(\"test\")","file":"tests/test_logging.py","line":89,"lexical":0.65,"target":true},{"text":"File: tests/test_subclassing.py\nLine 16: raise Exception(\"test\")","file":"tests/test_subclassing.py","line":16,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"세션에 리다이렉트 플래그를 설정한 뒤 특정 경로로 이동시키는 테스트 로직이 포함되어 있습니다. 이 동작이 의도된 것인지 확인 부탁드립니다.","query":"session redirect flask","file":"tests/test_testing.py","symbol":"index","line":142,"lang":"ko","candidates":[{"text":"File: tests/test_testing.py\nLine 143: flask.session[\"redirect\"] = True","file":"tests/test_testing.py","line":143,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_testing.py\nLine 153: assert flask.session[\"redirect\"] is True","file":"tests/test_testing.py","line":153,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"我想在 Web 应用里给 Jinja 模板添加自定义的处理函数。帮我找一下实现这个功能的方法,看看它是怎么把函数注册到渲染环境里的。","query":"register jinja filter","file":"src/flask/sansio/app.py","symbol":"add_template_filter","line":699,"lang":"zh","candidates":[{"text":"File: src/flask/sansio/app.py\nLine 673: \"\"\"Decorate a function to register it as a custom Jinja filter. The name","file":"src/flask/sansio/app.py","line":673,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 702: \"\"\"Register a function to use as a custom Jinja filter.","file":"src/flask/sansio/app.py","line":702,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 453: \"\"\"Decorate a function to register it as a custom Jinja filter. The name","file":"src/flask/sansio/blueprints.py","line":453,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 479: \"\"\"Register a function to use as a custom Jinja filter.","file":"src/flask/sansio/blueprints.py","line":479,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"我想在文档中找到关于模板(Template)的介绍部分。","query":"templates","file":"docs/templating.rst","symbol":"Templates","line":1,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 196: ``propagate_exceptions``, and ``templates_auto_reload`` properties on ``app``","file":"CHANGES.rst","line":196,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 314: ``templates_auto_reload``. Use the relevant config keys instead.","file":"CHANGES.rst","line":314,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1115: - Templates are no longer automatically reloaded outside of debug","file":"CHANGES.rst","line":1115,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1116: mode. This can be configured with the new ``TEMPLATES_AUTO_RELOAD``","file":"CHANGES.rst","line":1116,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1139: enabled will instruct Flask to explain how it locates templates.","file":"CHANGES.rst","line":1139,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1140: This should help users debug when the wrong templates are loaded.","file":"CHANGES.rst","line":1140,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1219: - ``tojson`` used in templates is now safe by default. This was","file":"CHANGES.rst","line":1219,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1230: - Templates can now be rendered without request context. The behavior","file":"CHANGES.rst","line":1230,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1236: imported templates by default.","file":"CHANGES.rst","line":1236,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1252: templates. One has to be very careful with those though because","file":"CHANGES.rst","line":1252,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1422: - Fixed the Jinja environment's ``list_templates`` method not","file":"CHANGES.rst","line":1422,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1532: - ``Flask.config`` is now available in the templates as ``config``.","file":"CHANGES.rst","line":1532,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1557: - Fixed another issue with loading templates from directories when","file":"CHANGES.rst","line":1557,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1579: - Autoescaping is no longer active for all templates. Instead it is","file":"CHANGES.rst","line":1579,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1581: templates this behavior can be changed with the ``autoescape`` tag.","file":"CHANGES.rst","line":1581,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 29: * Provide template filters, static files, templates, and other utilities","file":"docs/blueprints.rst","line":29,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 60: implement a blueprint that does simple rendering of static templates::","file":"docs/blueprints.rst","line":60,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 66: template_folder='templates')","file":"docs/blueprints.rst","line":66,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 219: Templates","file":"docs/blueprints.rst","line":219,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 222: If you want the blueprint to expose templates you can do that by providing","file":"docs/blueprints.rst","line":222,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 225: admin = Blueprint('admin', __name__, template_folder='templates')","file":"docs/blueprints.rst","line":225,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 230: The template folder is added to the search path of templates but with a lower","file":"docs/blueprints.rst","line":230,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 232: easily override templates that a blueprint provides in the actual application.","file":"docs/blueprints.rst","line":232,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 241: ``templates`` as a `template_folder` you will have to create a file like","file":"docs/blueprints.rst","line":241,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 242: this: :file:`yourapplication/admin/templates/admin/index.html`. The reason","file":"docs/blueprints.rst","line":242,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 249: blueprint, the best idea is to lay out your templates like this::","file":"docs/blueprints.rst","line":249,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 254: templates/","file":"docs/blueprints.rst","line":254,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 261: the correct templates enable the ``EXPLAIN_TEMPLATE_LOADING`` config","file":"docs/blueprints.rst","line":261,"lexical":0.35,"target":false},{"text":"File: docs/blueprints.rst\nLine 263: to locate templates on every ``render_template`` call.","file":"docs/blueprints.rst","line":263,"lexical":0.35,"target":false},{"text":"File: docs/config.rst\nLine 370: .. py:data:: TEMPLATES_AUTO_RELOAD","file":"docs/config.rst","line":370,"lexical":0.35,"target":false},{"text":"File: docs/config.rst\nLine 372: Reload templates when they are changed. If not set, it will be enabled in","file":"docs/config.rst","line":372,"lexical":0.35,"target":false},{"text":"File: docs/config.rst\nLine 422: ``SESSION_REFRESH_EACH_REQUEST``, ``TEMPLATES_AUTO_RELOAD``,","file":"docs/config.rst","line":422,"lexical":0.35,"target":false}]} {"site":"project_search","repo":"flask","task":"Como essa classe recebe a instância do framework?","query":"flask app init","file":"src/flask/templating.py","symbol":"__init__","line":54,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 1088: - Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from","file":"CHANGES.rst","line":1088,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 46: def celery_init_app(app: Flask) -> Celery:","file":"docs/patterns/celery.rst","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 101: When using the Flask application factory pattern, call the ``celery_init_app`` function","file":"docs/patterns/celery.rst","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 213: $ flask --app flaskr init-db","file":"docs/tutorial/database.rst","line":213,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 44: $ flask --app flaskr init-db","file":"docs/tutorial/deploy.rst","line":44,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/src/task_app/__init__.py\nLine 29: def celery_init_app(app: Flask) -> Celery:","file":"examples/celery/src/task_app/__init__.py","line":29,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/README.rst\nLine 50: $ flask --app flaskr init-db","file":"examples/tutorial/README.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 271: def __init__(self, app: Flask, **kwargs: t.Any) -> None:","file":"src/flask/testing.py","line":271,"lexical":0.55,"target":false},{"text":"File: tests/test_instance_config.py\nLine 52: (ns / \"__init__.py\").write_text(\"import flask\\napp = flask.Flask(__name__)\\n\")","file":"tests/test_instance_config.py","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_instance_config.py\nLine 89: (app / \"__init__.py\").write_text(\"import flask\\napp = flask.Flask(__name__)\\n\")","file":"tests/test_instance_config.py","line":89,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_instance_config.py\nLine 104: (app / \"__init__.py\").write_text(\"import flask\\napp = flask.Flask(__name__)\\n\")","file":"tests/test_instance_config.py","line":104,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"flaskのデバッグモードを有効にしたアプリケーションの生成処理を探して","query":"flask debug app","file":"tests/test_cli.py","symbol":"create_app","line":366,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 353: - Add ``--app`` and ``--debug`` options to the ``flask`` CLI, instead","file":"CHANGES.rst","line":353,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 98: $ flask --app hello run --debug","file":"docs/cli.rst","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 111: $ flask --app hello --debug run","file":"docs/cli.rst","line":111,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 112: $ flask --app hello run --debug","file":"docs/cli.rst","line":112,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 547: debug mode. ``--app hello`` should be the import or file with your Flask app.","file":"docs/cli.rst","line":547,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 55: $ flask --app hello run --debug","file":"docs/config.rst","line":55,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/debugging.rst\nLine 46: $ flask --app hello run --debug","file":"docs/debugging.rst","line":46,"lexical":0.65,"target":false},{"text":"File: docs/debugging.rst\nLine 69: When using an external debugger, the app should still be in debug mode, otherwise Flask","file":"docs/debugging.rst","line":69,"lexical":0.65,"target":false},{"text":"File: docs/debugging.rst\nLine 75: $ flask --app hello run --debug --no-debugger --no-reload","file":"docs/debugging.rst","line":75,"lexical":0.65,"target":false},{"text":"File: docs/quickstart.rst\nLine 111: $ flask --app hello run --debug","file":"docs/quickstart.rst","line":111,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/server.rst\nLine 27: $ flask --app hello run --debug","file":"docs/server.rst","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 137: $ flask --app flaskr run --debug","file":"docs/tutorial/factory.rst","line":137,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/README.md\nLine 22: $ flask -A task_app run --debug","file":"examples/celery/README.md","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/README.rst\nLine 51: $ flask --app flaskr run --debug","file":"examples/tutorial/README.rst","line":51,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 371: @click.group(cls=FlaskGroup, create_app=create_app, set_debug_flag=set_debug_flag)","file":"tests/test_cli.py","line":371,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"Comment est-ce que je peux enregistrer une fonction personnalisée pour qu'elle soit utilisable dans les templates Jinja ?","query":"register template filter","file":"src/flask/sansio/blueprints.py","symbol":"app_template_filter","line":444,"lang":"fr","candidates":[{"text":"File: docs/templating.rst\nLine 147: Decorate a function with :meth:`~.Flask.template_filter` to register it as a","file":"docs/templating.rst","line":147,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 170: A filter can be registered separately using :meth:`~.Flask.add_template_filter`.","file":"docs/templating.rst","line":170,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 682: The :meth:`add_template_filter` method may be used to register a","file":"src/flask/sansio/app.py","line":682,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 704: The :meth:`template_filter` decorator can be used to register a function","file":"src/flask/sansio/app.py","line":704,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 456: The :meth:`add_app_template_filter` method may be used to register a","file":"src/flask/sansio/blueprints.py","line":456,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 481: The :meth:`app_template_filter` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":481,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 492: def register_template_filter(state: BlueprintSetupState) -> None:","file":"src/flask/sansio/blueprints.py","line":492,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 495: self.record_once(register_template_filter)","file":"src/flask/sansio/blueprints.py","line":495,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm trying to figure out how we handle the logic for executing a callback only during the very first time a module is being registered. Where is the conditional check that ensures the underlying function runs only when the setup state indicates it's the initial pass?","query":"first_registration state","file":"src/flask/sansio/blueprints.py","symbol":"wrapper","line":240,"lang":"en","candidates":[{"text":"File: src/flask/sansio/blueprints.py\nLine 241: if state.first_registration:","file":"src/flask/sansio/blueprints.py","line":241,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 253: return BlueprintSetupState(self, app, options, first_registration)","file":"src/flask/sansio/blueprints.py","line":253,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Ich schreibe gerade die Testsuiten für die Dateiübertragung um. Kannst du mir zeigen, wo die Logik definiert ist, die festlegt, wie lange eine Datei als gültig gilt?","query":"max age file","file":"tests/test_helpers.py","symbol":"get_send_file_max_age","line":70,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 195: - The ``session_cookie_name``, ``send_file_max_age_default``, ``use_x_sendfile``,","file":"CHANGES.rst","line":195,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 290: ``download_name`` replaces ``attachment_filename``, ``max_age``","file":"CHANGES.rst","line":290,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 312: ``session_cookie_name``, ``send_file_max_age_default``,","file":"CHANGES.rst","line":312,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 548: ``get_send_file_max_age``. :issue:`4044`, :pr:`4026`","file":"CHANGES.rst","line":548,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 632: - ``send_file`` sets ``conditional=True`` and ``max_age=None`` by","file":"CHANGES.rst","line":632,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1337: - ``Flask`` and ``Blueprint`` now provide a ``get_send_file_max_age``","file":"CHANGES.rst","line":1337,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1342: controls by file extension. The default max-age for ``send_file``","file":"CHANGES.rst","line":1342,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1344: ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is used","file":"CHANGES.rst","line":1344,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1345: in the default ``get_send_file_max_age`` implementation.","file":"CHANGES.rst","line":1345,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 250: .. py:data:: SEND_FILE_MAX_AGE_DEFAULT","file":"docs/config.rst","line":250,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 252: When serving files, set the cache control max age to this number of","file":"docs/config.rst","line":252,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 255: :meth:`~flask.Flask.get_send_file_max_age` on the application or","file":"docs/config.rst","line":255,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 230: \"SEND_FILE_MAX_AGE_DEFAULT\": None,","file":"src/flask/app.py","line":230,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 366: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/app.py","line":366,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 367: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/app.py","line":367,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 370: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/app.py","line":370,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 383: value = self.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/app.py","line":383,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 408: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/app.py","line":408,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 410: max_age = self.get_send_file_max_age(filename)","file":"src/flask/app.py","line":410,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 412: t.cast(str, self.static_folder), filename, max_age=max_age","file":"src/flask/app.py","line":412,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 55: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/blueprints.py","line":55,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 56: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/blueprints.py","line":56,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 59: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/blueprints.py","line":59,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 72: value = current_app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/blueprints.py","line":72,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 97: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/blueprints.py","line":97,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 99: max_age = self.get_send_file_max_age(filename)","file":"src/flask/blueprints.py","line":99,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 101: t.cast(str, self.static_folder), filename, max_age=max_age","file":"src/flask/blueprints.py","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 406: kwargs[\"max_age\"] = ctx.app.get_send_file_max_age","file":"src/flask/helpers.py","line":406,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 463: :param max_age: How long the client should cache the file, in","file":"src/flask/helpers.py","line":463,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 515: :meth:`Flask.get_send_file_max_age`.","file":"src/flask/helpers.py","line":515,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 194: max_age_default = app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"tests/test_blueprints.py","line":194,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 197: if app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] == expected_max_age:","file":"tests/test_blueprints.py","line":197,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Je rencontre un problème avec le paramètre d'application Flask. Lorsque je fournis une valeur pour l'import de l'application via la ligne de commande, elle ne semble pas être enregistrée correctement dans le contexte du script, ce qui empêche l'initialisation correcte de l'application. Pouvez-vous vérifier comment la valeur est assignée à `app_import_path` dans l'objet `ScriptInfo` ?","query":"script info app import","file":"src/flask/cli.py","symbol":"_set_app","line":440,"lang":"fr","candidates":[{"text":"File: tests/test_cli.py\nLine 247: obj = ScriptInfo(app_import_path=\"cliapp.app:testapp\")","file":"tests/test_cli.py","line":247,"lexical":0.5,"target":false},{"text":"File: tests/test_cli.py\nLine 255: obj = ScriptInfo(app_import_path=cli_app_path)","file":"tests/test_cli.py","line":255,"lexical":0.5,"target":false},{"text":"File: tests/test_cli.py\nLine 259: obj = ScriptInfo(app_import_path=f\"{cli_app_path}:testapp\")","file":"tests/test_cli.py","line":259,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"La validación de parámetros en la interfaz de línea de comandos está fallando porque no detecta correctamente si la aplicación está activa durante la ejecución de los callbacks.","query":"param callback app","file":"tests/test_cli.py","symbol":"_param_cb","line":289,"lang":"es","candidates":[{"text":"File: src/flask/cli.py\nLine 391: ``app.cli`` command and parameter callbacks.","file":"src/flask/cli.py","line":391,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 541: :param create_app: an optional callback that is passed the script info and","file":"src/flask/cli.py","line":541,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 290: # current_app should be available in parameter callbacks","file":"tests/test_cli.py","line":290,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"Comment enregistrer une fonction qui s'exécute automatiquement à la fin d'une requête, même en cas d'exception ?","query":"request teardown handler","file":"src/flask/sansio/scaffold.py","symbol":"teardown_request","line":516,"lang":"fr","candidates":[{"text":"File: docs/async-await.rst\nLine 8: Routes, error handlers, before request, after request, and teardown","file":"docs/async-await.rst","line":8,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 777: def test_teardown_request_handler(app, client):","file":"tests/test_basic.py","line":777,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 795: def test_teardown_request_handler_debug_mode(app, client):","file":"tests/test_basic.py","line":795,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 813: def test_teardown_request_handler_error(app, client):","file":"tests/test_basic.py","line":813,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"새로운 경로와 뷰 함수를 등록하는 기능 찾아줘","query":"add url rule","file":"src/flask/sansio/app.py","symbol":"add_url_rule","line":605,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 875: - ``Flask.add_url_rule`` accepts the ``provide_automatic_options``","file":"CHANGES.rst","line":875,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 909: detected by ``Flask.add_url_rule``. :pr:`2316`","file":"CHANGES.rst","line":909,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1468: ``add_url_rule`` function and can now also accept regular werkzeug","file":"CHANGES.rst","line":1468,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1469: rules added to the url map.","file":"CHANGES.rst","line":1469,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1527: application explicitly adds 'OPTIONS' as method to the URL rule. In","file":"CHANGES.rst","line":1527,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1537: - The endpoint for the ``Module.add_url_rule`` method is now optional","file":"CHANGES.rst","line":1537,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1649: - ``Flask.add_url_rule`` can now also register a view function.","file":"CHANGES.rst","line":1649,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 535: 2. You can use the :meth:`flask.Flask.add_url_rule` function.","file":"docs/api.rst","line":535,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 610: :meth:`~flask.Flask.add_url_rule` accept. The only difference is that","file":"docs/api.rst","line":610,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 646: some defaults to :meth:`~flask.Flask.add_url_rule` or general behavior:","file":"docs/api.rst","line":646,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 653: - `methods`: If methods are not provided when the URL rule is added,","file":"docs/api.rst","line":653,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 678: app.add_url_rule('/', index)","file":"docs/api.rst","line":678,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/favicon.rst\nLine 27: app.add_url_rule(","file":"docs/patterns/favicon.rst","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 123: app.add_url_rule(","file":"docs/patterns/fileuploads.rst","line":123,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 16: :meth:`~flask.Flask.add_url_rule` function. Instead of using decorators,","file":"docs/patterns/lazyloading.rst","line":16,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 50: app.add_url_rule('/', view_func=views.index)","file":"docs/patterns/lazyloading.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 51: app.add_url_rule('/user/', view_func=views.user)","file":"docs/patterns/lazyloading.rst","line":51,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 85: app.add_url_rule('/',","file":"docs/patterns/lazyloading.rst","line":85,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 87: app.add_url_rule('/user/',","file":"docs/patterns/lazyloading.rst","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 92: :meth:`~flask.Flask.add_url_rule` by prefixing a string with the project","file":"docs/patterns/lazyloading.rst","line":92,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 98: app.add_url_rule(url_rule, view_func=view, **options)","file":"docs/patterns/lazyloading.rst","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 167: app.url_map.add(Rule('/', endpoint='index'))","file":"docs/patterns/viewdecorators.rst","line":167,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 46: app.add_url_rule('/', endpoint='index')","file":"docs/tutorial/blog.rst","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 58: ``index`` endpoint. :meth:`app.add_url_rule() `","file":"docs/tutorial/blog.rst","line":58,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 53: app.add_url_rule(\"/users/\", view_func=UserList.as_view(\"user_list\"))","file":"docs/views.rst","line":53,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 58: :meth:`~flask.Flask.add_url_rule` method. The first argument to","file":"docs/views.rst","line":58,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 91: app.add_url_rule(","file":"docs/views.rst","line":91,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 95: app.add_url_rule(","file":"docs/views.rst","line":95,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 119: app.add_url_rule(","file":"docs/views.rst","line":119,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 172: app.add_url_rule('/users/', view_func=UserList.as_view())","file":"docs/views.rst","line":172,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 182: app.add_url_rule('/users/', view_func=view)","file":"docs/views.rst","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 202: ``add_url_rule`` or ``route``.","file":"docs/views.rst","line":202,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"기본적인 테스트 케이스에서 고정된 문자열을 반환하는 함수가 어디에 정의되어 있어?","query":"return \"bar\"","file":"tests/test_basic.py","symbol":"bar","line":204,"lang":"ko","candidates":[{"text":"File: tests/test_basic.py\nLine 205: return \"bar\"","file":"tests/test_basic.py","line":205,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_basic.py\nLine 227: return \"bar\"","file":"tests/test_basic.py","line":227,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1188: return {\"foo\": \"bar\"}, 201","file":"tests/test_basic.py","line":1188,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1192: return [\"foo\", \"bar\"], 201","file":"tests/test_basic.py","line":1192,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1252: return \"Hello\", 234, {\"X-Foo\": \"Bar\"}, \"???\"","file":"tests/test_basic.py","line":1252,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"사용자 에러 핸들러 쪽 테스트 코드를 작성 중인데, 강제로 내부 서버 에러를 발생시키는 로직이 어디에 정의되어 있는지 확인하고 싶습니다. 500 에러를 던지는 간단한 보조 함수를 찾고 있어요.","query":"flask abort 500","file":"tests/test_user_error_handler.py","symbol":"do_abort","line":234,"lang":"ko","candidates":[{"text":"File: tests/test_user_error_handler.py\nLine 53: flask.abort(500)","file":"tests/test_user_error_handler.py","line":53,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 235: flask.abort(500)","file":"tests/test_user_error_handler.py","line":235,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"测试用例中渲染模板时,传入的布尔值参数被错误地设置为了 False,导致无法验证模板渲染布尔变量的正确逻辑。","query":"render_template False","file":"tests/test_templating.py","symbol":"index","line":311,"lang":"zh","candidates":[{"text":"File: tests/test_blueprints.py\nLine 597: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_blueprints.py","line":597,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 606: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_blueprints.py","line":606,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 630: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_blueprints.py","line":630,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 647: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_blueprints.py","line":647,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 664: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_blueprints.py","line":664,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 312: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_templating.py","line":312,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_templating.py\nLine 326: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_templating.py","line":326,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 339: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_templating.py","line":339,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 353: return flask.render_template(\"template_test.html\", value=False)","file":"tests/test_templating.py","line":353,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"busca la definición del método para convertir objetos a formato json","query":"json serialization","file":"src/flask/json/provider.py","symbol":"dumps","line":41,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 1210: - Changed default cookie serialization format from pickle to JSON to","file":"CHANGES.rst","line":1210,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 714: serialization library to convert the data to valid JSON types first.","file":"docs/quickstart.rst","line":714,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/json/tag.py\nLine 5: A compact representation for lossless serialization of non-standard JSON","file":"src/flask/json/tag.py","line":5,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"当应用未配置用于加密会话的密钥时,程序会抛出一个运行时错误并导致中断,请检查这个导致会话不可用的异常处理逻辑。","query":"session secret key","file":"src/flask/sessions.py","symbol":"_fail","line":89,"lang":"zh","candidates":[{"text":"File: docs/api.rst\nLine 57: :data:`SECRET_KEY`) you can use sessions in Flask applications. A session makes","file":"docs/api.rst","line":57,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 116: A secret key that will be used for securely signing the session cookie","file":"docs/config.rst","line":116,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 731: In order to use sessions you have to set a secret key. Here is how","file":"docs/quickstart.rst","line":731,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 57: modify the session cookie, or anything else that uses the secret key.","file":"docs/tutorial/deploy.rst","line":57,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 396: def test_session_secret_key_fallbacks(app, client) -> None:","file":"tests/test_basic.py","line":396,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 406: # Set session with initial secret key, and two valid expiring keys","file":"tests/test_basic.py","line":406,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 413: # Change secret key, session can't be loaded and appears empty","file":"tests/test_basic.py","line":413,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Se ha detectado un problema en el manejo de cookies dinámicas. Actualmente, la función asigna directamente el contenido del formulario a la sesión de flask sin ninguna validación previa. Esto podría permitir la inyección de datos no deseados o causar errores si el campo 'value' no está presente en el formulario. Por favor, verifique la lógica de asignación y asegúrese de que se manejen correctamente los casos donde el dato no esté disponible.","query":"dynamic cookie session","file":"tests/test_reqctx.py","symbol":"set_dynamic_cookie","line":228,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 593: session cookie name dynamically. :pr:`3369`","file":"CHANGES.rst","line":593,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 201: def test_session_dynamic_cookie_name():","file":"tests/test_reqctx.py","line":201,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"O teste de integração está falhando porque a rota principal da aplicação está retornando apenas uma saudação estática em vez de processar a lógica esperada.","query":"return hello world","file":"tests/test_basic.py","symbol":"index","line":45,"lang":"pt","candidates":[{"text":"File: README.md\nLine 30: return \"Hello, World!\"","file":"README.md","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 674: return 'Hello World!'","file":"docs/api.rst","line":674,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/design.rst\nLine 26: return 'Hello World!'","file":"docs/design.rst","line":26,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/design.rst\nLine 34: return 'Hello World!'","file":"docs/design.rst","line":34,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 96: return f\"Hello, {request.args.get(\"name\", \"World\")}!\"","file":"docs/gevent.rst","line":96,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 29: return \"Hello, World!\"","file":"docs/lifecycle.rst","line":29,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 33: return 'Hello World!'","file":"docs/patterns/appdispatch.rst","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/packages.rst\nLine 99: return 'Hello World!'","file":"docs/patterns/packages.rst","line":99,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 171: return \"Hello world\"","file":"docs/patterns/viewdecorators.rst","line":171,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 21: return \"

Hello, World!

\"","file":"docs/quickstart.rst","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 169: return 'Hello, World'","file":"docs/quickstart.rst","line":169,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 64: return 'Hello, World!'","file":"docs/tutorial/factory.rst","line":64,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 118: function that returns a response, the string ``'Hello, World!'`` in","file":"docs/tutorial/factory.rst","line":118,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/layout.rst\nLine 32: return 'Hello, World!'","file":"docs/tutorial/layout.rst","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 163: the beginning of the tutorial. It returns \"Hello, World!\", so the test","file":"docs/tutorial/tests.rst","line":163,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 28: return \"Hello, World!\"","file":"examples/tutorial/flaskr/__init__.py","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 135: return \"Hello, World!\"","file":"src/flask/ctx.py","line":135,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 316: return hello('World')","file":"src/flask/helpers.py","line":316,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 353: return \"Hello, World!\"","file":"src/flask/sansio/scaffold.py","line":353,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/helloworld/hello.py\nLine 8: return \"Hello World!\"","file":"tests/test_apps/helloworld/hello.py","line":8,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 36: return \"Hello World\"","file":"tests/test_basic.py","line":36,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_basic.py\nLine 46: return \"Hello World\"","file":"tests/test_basic.py","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 81: return \"Hello World!\"","file":"tests/test_basic.py","line":81,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 98: return \"Hello World!\"","file":"tests/test_basic.py","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 113: return \"Hello World!\"","file":"tests/test_basic.py","line":113,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 285: return \"Hello World\"","file":"tests/test_basic.py","line":285,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 307: return \"Hello World\"","file":"tests/test_basic.py","line":307,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 328: return \"Hello World\"","file":"tests/test_basic.py","line":328,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 360: return \"Hello World\"","file":"tests/test_basic.py","line":360,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1180: return app.response_class(\"Hello world\", 400), 500","file":"tests/test_basic.py","line":1180,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1701: return \"Hello World!\"","file":"tests/test_basic.py","line":1701,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 168: return \"Hello World!\"","file":"tests/test_reqctx.py","line":168,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Cómo puedo probar que los errores de la aplicación se redirigen correctamente a un flujo de entrada personalizado en lugar de la salida estándar?","query":"test error stream","file":"tests/test_logging.py","symbol":"test_wsgi_errors_stream","line":54,"lang":"es","candidates":[{"text":"File: tests/test_logging.py\nLine 54: def test_wsgi_errors_stream(app, client):","file":"tests/test_logging.py","line":54,"lexical":0.65,"target":true},{"text":"File: tests/test_logging.py\nLine 62: assert \"ERROR in test_logging: test\" in stream.getvalue()","file":"tests/test_logging.py","line":62,"lexical":0.65,"target":false},{"text":"File: tests/test_logging.py\nLine 66: with app.test_request_context(errors_stream=stream):","file":"tests/test_logging.py","line":66,"lexical":0.65,"target":false},{"text":"File: tests/test_subclassing.py\nLine 18: rv = app.test_client().get(\"/\", errors_stream=out)","file":"tests/test_subclassing.py","line":18,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Il semble y avoir un problème dans la logique de redirection des vues : la méthode qui gère l'affichage ne fait que renvoyer le résultat du rendu du template sans vérifier si le nom du template est correctement passé ou si d'autres paramètres de contexte sont nécessaires.","query":"render template view","file":"tests/type_check/typing_route.py","symbol":"dispatch_request","line":105,"lang":"fr","candidates":[{"text":"File: docs/views.rst\nLine 41: and render a template. As the first step, we'll convert the view to a","file":"docs/views.rst","line":41,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/test_auth.py\nLine 9: # test that viewing the page renders without template errors","file":"examples/tutorial/tests/test_auth.py","line":9,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_auth.py\nLine 40: # test that viewing the page renders without template errors","file":"examples/tutorial/tests/test_auth.py","line":40,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 647: \"\"\"Like :meth:`context_processor`, but for templates rendered by every view, not","file":"src/flask/sansio/blueprints.py","line":647,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 560: for templates rendered from the blueprint's views. To register with a blueprint","file":"src/flask/sansio/scaffold.py","line":560,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 101: class RenderTemplateView(View):","file":"tests/type_check/typing_route.py","line":101,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/type_check/typing_route.py\nLine 102: def __init__(self: RenderTemplateView, template_name: str) -> None:","file":"tests/type_check/typing_route.py","line":102,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 105: def dispatch_request(self: RenderTemplateView) -> str:","file":"tests/type_check/typing_route.py","line":105,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 111: view_func=RenderTemplateView.as_view(\"about_page\", template_name=\"about.html\"),","file":"tests/type_check/typing_route.py","line":111,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"O comportamento padrão do código de status para redirecionamentos mudou de 302 para 303, isso pode estar quebrando integrações que esperam um redirecionamento temporário clássico. Preciso localizar onde essa lógica de criação de resposta de redirecionamento está definida para validar o novo padrão.","query":"redirect status code","file":"src/flask/sansio/app.py","symbol":"redirect","line":939,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 22: - ``redirect`` returns a ``303`` status code by default instead of ``302``.","file":"CHANGES.rst","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 264: :param code: The status code for the redirect.","file":"src/flask/helpers.py","line":264,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 946: :param code: The status code for the redirect.","file":"src/flask/sansio/app.py","line":946,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"HTML 템플릿을 스트림 형태로 반환할 때, 특정 변수 값을 주입해서 생성하는 로직이 제대로 작동하는지 확인이 필요합니다. 테스트 코드에서 템플릿 스트림을 생성하는 부분의 동작을 점검해 주세요.","query":"template stream iterator","file":"tests/type_check/typing_route.py","symbol":"return_template_stream","line":92,"lang":"ko","candidates":[{"text":"File: src/flask/templating.py\nLine 200: def stream_template_string(source: str, **context: t.Any) -> t.Iterator[str]:","file":"src/flask/templating.py","line":200,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 92: def return_template_stream() -> t.Iterator[str]:","file":"tests/type_check/typing_route.py","line":92,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"¿Cómo se carga un objeto JSON directamente desde un archivo?","query":"json file load","file":"src/flask/json/provider.py","symbol":"load","line":67,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 439: ``config.from_file(name, load=json.load)``.","file":"CHANGES.rst","line":439,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 539: app.config.from_file(\"config.json\", load=json.load)","file":"docs/config.rst","line":539,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/config.py\nLine 270: app.config.from_file(\"config.json\", load=json.load)","file":"src/flask/config.py","line":270,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_config.py\nLine 34: app.config.from_file(os.path.join(current_dir, \"static\", \"config.json\"), json.load)","file":"tests/test_config.py","line":34,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_config.py\nLine 189: app.config.from_file(\"missing.json\", load=json.load)","file":"tests/test_config.py","line":189,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_config.py\nLine 195: assert not app.config.from_file(\"missing.json\", load=json.load, silent=True)","file":"tests/test_config.py","line":195,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"애플리케이션 컨텍스트 내에서 작업을 실행하는 호출 방식 찾아줘","query":"app context run","file":"examples/celery/src/task_app/__init__.py","symbol":"__call__","line":31,"lang":"ko","candidates":[{"text":"File: docs/appcontext.rst\nLine 50: RuntimeError: Working outside of application context.","file":"docs/appcontext.rst","line":50,"lexical":0.65,"target":false},{"text":"File: docs/appcontext.rst\nLine 120: app will be run during the context.","file":"docs/appcontext.rst","line":120,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 623: application. This runs all the registered shell context","file":"src/flask/app.py","line":623,"lexical":0.65,"target":false},{"text":"File: src/flask/cli.py\nLine 555: An app context is pushed when running ``app.cli`` commands, so","file":"src/flask/cli.py","line":555,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 999: @click.command(\"shell\", short_help=\"Run a shell in the app context.\")","file":"src/flask/cli.py","line":999,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 288: def test_app_cli_has_app_context(app, runner):","file":"tests/test_cli.py","line":288,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 306: def test_with_appcontext(runner):","file":"tests/test_cli.py","line":306,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 319: def test_appgroup_app_context(runner):","file":"tests/test_cli.py","line":319,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 347: def test_flaskgroup_app_context(runner):","file":"tests/test_cli.py","line":347,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"在 Flask 请求上下文中获取或初始化数据库连接,确保同一个请求内多次调用时返回的是同一个连接实例。","query":"get flask db","file":"examples/tutorial/flaskr/db.py","symbol":"get_db","line":9,"lang":"zh","candidates":[{"text":"File: docs/tutorial/blog.rst\nLine 29: from flaskr.db import get_db","file":"docs/tutorial/blog.rst","line":29,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 75: from flaskr.db import get_db, init_db","file":"docs/tutorial/tests.rst","line":75,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 180: from flaskr.db import get_db","file":"docs/tutorial/tests.rst","line":180,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 261: from flaskr.db import get_db","file":"docs/tutorial/tests.rst","line":261,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 375: from flaskr.db import get_db","file":"docs/tutorial/tests.rst","line":375,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 37: from flaskr.db import get_db","file":"docs/tutorial/views.rst","line":37,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 7: from flaskr.db import get_db","file":"examples/tutorial/tests/conftest.py","line":7,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_auth.py\nLine 5: from flaskr.db import get_db","file":"examples/tutorial/tests/test_auth.py","line":5,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_blog.py\nLine 3: from flaskr.db import get_db","file":"examples/tutorial/tests/test_blog.py","line":3,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_db.py\nLine 5: from flaskr.db import get_db","file":"examples/tutorial/tests/test_db.py","line":5,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"서브도메인 기반 라우팅이 올바르게 동작하는지 확인하기 위해 테스트 클라이언트로 요청을 보내고 응답 본문을 검증하는 테스트 케이스를 작성하고 싶습니다.","query":"subdomain test client","file":"tests/test_testing.py","symbol":"test_subdomain","line":304,"lang":"ko","candidates":[{"text":"File: tests/test_blueprints.py\nLine 1022: def test_nesting_subdomains(app, client) -> None:","file":"tests/test_blueprints.py","line":1022,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1041: def test_child_and_parent_subdomain(app, client) -> None:","file":"tests/test_blueprints.py","line":1041,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 323: def test_nosubdomain(app, client):","file":"tests/test_testing.py","line":323,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"O valor da variável de ambiente usada para configurar o ambiente de teste do Flask está incorreto ou não condiz com o esperado para o ambiente de desenvolvimento local.","query":"flask env test","file":"tests/test_apps/.flaskenv","symbol":"BAR","line":2,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 774: - ``flask.testing.make_test_environ_builder()`` has been deprecated in","file":"CHANGES.rst","line":774,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 775: favour of a new class ``flask.testing.EnvironBuilder``. :pr:`3232`","file":"CHANGES.rst","line":775,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 563: load_dotenv(test_path / \".flaskenv\")","file":"tests/test_cli.py","line":563,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 11: from flask.testing import EnvironBuilder","file":"tests/test_testing.py","line":11,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"find die funktion die eine division durch null provoziert","query":"raise ZeroDivisionError","file":"tests/test_signals.py","symbol":"index","line":171,"lang":"de","candidates":[{"text":"File: tests/test_appctx.py\nLine 203: raise ZeroDivisionError","file":"tests/test_appctx.py","line":203,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 843: raise ZeroDivisionError","file":"tests/test_basic.py","line":843,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 910: raise ZeroDivisionError","file":"tests/test_basic.py","line":910,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 936: raise ZeroDivisionError","file":"tests/test_basic.py","line":936,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1106: raise ZeroDivisionError","file":"tests/test_basic.py","line":1106,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1111: raise ZeroDivisionError","file":"tests/test_basic.py","line":1111,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1616: raise ZeroDivisionError","file":"tests/test_basic.py","line":1616,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1621: with pytest.raises(ZeroDivisionError):","file":"tests/test_basic.py","line":1621,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_signals.py\nLine 101: raise ZeroDivisionError","file":"tests/test_signals.py","line":101,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_signals.py\nLine 172: raise ZeroDivisionError","file":"tests/test_signals.py","line":172,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_testing.py\nLine 224: raise ZeroDivisionError","file":"tests/test_testing.py","line":224,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 44: raise ZeroDivisionError","file":"tests/test_views.py","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 47: raise ZeroDivisionError","file":"tests/test_views.py","line":47,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"테스트용 클라이언트 객체를 생성해주는 함수가 어디에 정의되어 있어?","query":"test client","file":"examples/javascript/tests/conftest.py","symbol":"client","line":14,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 31: - Fix parsing IPv6 with port in ``run`` and the test client. :pr:`6096`","file":"CHANGES.rst","line":31,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 50: - When using ``follow_redirects`` in the test client, the final state","file":"CHANGES.rst","line":50,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 447: - The test client's ``as_tuple`` parameter is removed. Use","file":"CHANGES.rst","line":447,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 494: - The test client's ``as_tuple`` parameter is deprecated and will be","file":"CHANGES.rst","line":494,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 769: - When using the test client as a context manager (``with client:``),","file":"CHANGES.rst","line":769,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 818: - Passing the ``json`` argument to ``app.test_client`` does not","file":"CHANGES.rst","line":818,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 928: - Add ``json`` keyword argument for the test client request methods.","file":"CHANGES.rst","line":928,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 960: ``test_client.open``. :pr:`2412`","file":"CHANGES.rst","line":960,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 964: - When passing a full URL to the test client, the scheme in the URL is","file":"CHANGES.rst","line":964,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1078: - ``app.test_client`` includes preset default environment, which can","file":"CHANGES.rst","line":1078,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1100: - Added ``**kwargs`` to ``Flask.test_client`` to support passing","file":"CHANGES.rst","line":1100,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1102: ``Flask.test_client_class``.","file":"CHANGES.rst","line":1102,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1177: in the test client when absolute URLs were requested.","file":"CHANGES.rst","line":1177,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1404: - Implemented ``TestClient.session_transaction`` to easily modify","file":"CHANGES.rst","line":1404,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1406: - Refactored test client internally. The ``APPLICATION_ROOT``","file":"CHANGES.rst","line":1406,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1408: used by the test client as defaults.","file":"CHANGES.rst","line":1408,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1411: - Fixed an issue where the test client if used with the \"with\"","file":"CHANGES.rst","line":1411,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1419: of Flask itself and no longer of the test client. This cleaned up","file":"CHANGES.rst","line":1419,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1603: - Test client has not the ability to preserve the request context for","file":"CHANGES.rst","line":1603,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 124: Test Client","file":"docs/api.rst","line":124,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 482: c = app.test_client()","file":"docs/api.rst","line":482,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/appcontext.rst\nLine 95: The primary way to solve this is to use :meth:`.Flask.test_client` to simulate","file":"docs/appcontext.rst","line":95,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/signals.rst\nLine 59: This can now easily be paired with a test client::","file":"docs/signals.rst","line":59,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/signals.rst\nLine 62: rv = app.test_client().get('/')","file":"docs/signals.rst","line":62,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 41: test client, and CLI runner are shown below, they can be placed in","file":"docs/testing.rst","line":41,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 75: return app.test_client()","file":"docs/testing.rst","line":75,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 83: Sending Requests with the Test Client","file":"docs/testing.rst","line":83,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 86: The test client makes requests to the application without running a live","file":"docs/testing.rst","line":86,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 88: :doc:`Werkzeug's client `, see those docs for additional","file":"docs/testing.rst","line":88,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 106: def test_request_example(client):","file":"docs/testing.rst","line":106,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 143: def test_edit_user(client):","file":"docs/testing.rst","line":143,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 163: def test_json_data(client):","file":"docs/testing.rst","line":163,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"验证在异步视图中,应用级和蓝图级的 before_request 与 after_request 钩子是否能正确按预期顺序执行并被调用。","query":"async before after request","file":"tests/test_async.py","symbol":"test_async_before_after_request","line":97,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 645: - Support async views, error handlers, before and after request, and","file":"CHANGES.rst","line":645,"lexical":0.5,"target":false},{"text":"File: tests/test_async.py\nLine 97: def test_async_before_after_request():","file":"tests/test_async.py","line":97,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"在哪里定义了端口占用报错的信息?","query":"address already in use","file":"docs/server.rst","symbol":"Address already in use","line":37,"lang":"zh","candidates":[{"text":"File: docs/cli.rst\nLine 85: server tries to start. See :ref:`address-already-in-use` for how to","file":"docs/cli.rst","line":85,"lexical":0.5,"target":false},{"text":"File: docs/quickstart.rst\nLine 66: server tries to start. See :ref:`address-already-in-use` for how to","file":"docs/quickstart.rst","line":66,"lexical":0.5,"target":false},{"text":"File: docs/server.rst\nLine 35: .. _address-already-in-use:","file":"docs/server.rst","line":35,"lexical":0.5,"target":true},{"text":"File: docs/server.rst\nLine 37: Address already in use","file":"docs/server.rst","line":37,"lexical":0.5,"target":false},{"text":"File: docs/server.rst\nLine 44: - ``OSError: [Errno 98] Address already in use``","file":"docs/server.rst","line":44,"lexical":0.5,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 156: server tries to start. See :ref:`address-already-in-use` for how to","file":"docs/tutorial/factory.rst","line":156,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"How does this helper construct a BaseRequest object using EnvironBuilder and handle cleanup?","query":"EnvironBuilder request builder","file":"src/flask/testing.py","symbol":"_request_from_builder_args","line":193,"lang":"en","candidates":[{"text":"File: src/flask/testing.py\nLine 212: args[0], (werkzeug.test.EnvironBuilder, dict, BaseRequest)","file":"src/flask/testing.py","line":212,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/testing.py\nLine 219: request = EnvironBuilder.from_environ(","file":"src/flask/testing.py","line":219,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm looking for the mechanism that allows us to register custom Jinja functions through our blueprint setup. How does the system ensure these filters are applied to the main application state during initialization?","query":"blueprint template filter","file":"src/flask/sansio/blueprints.py","symbol":"add_app_template_filter","line":476,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1312: - Blueprints now have a decorator to add custom template filters","file":"CHANGES.rst","line":1312,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1313: application wide, ``Blueprint.app_template_filter``.","file":"CHANGES.rst","line":1313,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1317: ``Blueprint.add_app_template_filter``.","file":"CHANGES.rst","line":1317,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 460: blueprint. Equivalent to :meth:`.Flask.template_filter`.","file":"src/flask/sansio/blueprints.py","line":460,"lexical":0.65,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 485: blueprint. Equivalent to :meth:`.Flask.add_template_filter`.","file":"src/flask/sansio/blueprints.py","line":485,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 492: def register_template_filter(state: BlueprintSetupState) -> None:","file":"src/flask/sansio/blueprints.py","line":492,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Reporte de error: El objeto de registro de eventos no está utilizando el nombre de la aplicación y no ajusta automáticamente el nivel de severidad al modo de depuración.","query":"app logger debug","file":"src/flask/sansio/app.py","symbol":"logger","line":440,"lang":"es","candidates":[{"text":"File: docs/quickstart.rst\nLine 818: app.logger.debug('A value for debugging')","file":"docs/quickstart.rst","line":818,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/logging.py\nLine 73: if app.debug and not logger.level:","file":"src/flask/logging.py","line":73,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 42: def test_logger_debug(app):","file":"tests/test_logging.py","line":42,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 44: assert app.logger.level == logging.DEBUG","file":"tests/test_logging.py","line":44,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"konfigurationswerte aus umgebungsvariabladen mit spezifischem prädikat laden und typisieren","query":"load config env prefix","file":"src/flask/config.py","symbol":"from_prefixed_env","line":126,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 483: - Add ``Config.from_prefixed_env()`` to load config values from","file":"CHANGES.rst","line":483,"lexical":0.5,"target":false},{"text":"File: docs/config.rst\nLine 606: the ``loads`` argument of :meth:`~flask.Config.from_prefixed_env`.","file":"docs/config.rst","line":606,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"调用请求分发前的预处理逻辑,包括URL值预处理和before_request钩子。如果任何钩子返回非None值,则直接返回该响应并停止后续处理。","query":"preprocess request","file":"src/flask/app.py","symbol":"preprocess_request","line":1369,"lang":"zh","candidates":[{"text":"File: docs/patterns/requestchecksum.rst\nLine 4: Various pieces of code can consume the request data and preprocess it.","file":"docs/patterns/requestchecksum.rst","line":4,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/shell.rst\nLine 48: :meth:`~flask.Flask.preprocess_request`:","file":"docs/shell.rst","line":48,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/shell.rst\nLine 52: >>> app.preprocess_request()","file":"docs/shell.rst","line":52,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/shell.rst\nLine 54: Keep in mind that the :meth:`~flask.Flask.preprocess_request` function","file":"docs/shell.rst","line":54,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 317: app.preprocess_request()","file":"docs/testing.rst","line":317,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 270: cls.preprocess_request,","file":"src/flask/app.py","line":270,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/app.py\nLine 1017: rv = self.preprocess_request(ctx)","file":"src/flask/app.py","line":1017,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1369: def preprocess_request(self, ctx: AppContext) -> ft.ResponseReturnValue | None:","file":"src/flask/app.py","line":1369,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 676: \"\"\"Like :meth:`url_value_preprocessor`, but for every request, not only those","file":"src/flask/sansio/blueprints.py","line":676,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 586: every request, use :meth:`.Blueprint.app_url_value_preprocessor`.","file":"src/flask/sansio/scaffold.py","line":586,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 735: def test_request_preprocessing_early_return(app, client):","file":"tests/test_basic.py","line":735,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"로거의 현재 레벨을 처리할 수 있는 핸들러가 상위로 전파되는 과정 중에 있는지 확인하는 로직 어디 있어?","query":"logger level handler","file":"src/flask/logging.py","symbol":"has_level_handler","line":31,"lang":"ko","candidates":[{"text":"File: src/flask/logging.py\nLine 31: def has_level_handler(logger: logging.Logger) -> bool:","file":"src/flask/logging.py","line":31,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/logging.py\nLine 67: If there is no handler for the logger's effective level, add a","file":"src/flask/logging.py","line":67,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/logging.py\nLine 76: if not has_level_handler(logger):","file":"src/flask/logging.py","line":76,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 72: assert not has_level_handler(logger)","file":"tests/test_logging.py","line":72,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 76: assert has_level_handler(logger)","file":"tests/test_logging.py","line":76,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 79: assert not has_level_handler(logger)","file":"tests/test_logging.py","line":79,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_logging.py\nLine 83: assert not has_level_handler(logger)","file":"tests/test_logging.py","line":83,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"클래스 기반 뷰를 사용하는 방법에 대해 설명해줘","query":"class based views","file":"docs/views.rst","symbol":"Class-based Views","line":1,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 1410: (class-based) views.","file":"CHANGES.rst","line":1410,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1498: - Implemented generic class-based views.","file":"CHANGES.rst","line":1498,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 514: Class-Based Views","file":"docs/api.rst","line":514,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/async-await.rst\nLine 20: Pluggable class-based views also support handlers that are implemented as","file":"docs/async-await.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 1: Class-based Views","file":"docs/views.rst","line":1,"lexical":0.65,"target":true},{"text":"File: docs/views.rst\nLine 7: classes to write class-based views.","file":"docs/views.rst","line":7,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"find the function that validates a custom error type and returns a string","query":"decorator exception handler","file":"tests/test_blueprints.py","symbol":"my_decorator_exception_handler","line":55,"lang":"en","candidates":[{"text":"File: tests/test_blueprints.py\nLine 54: @blue.errorhandler(MyDecoratorException)","file":"tests/test_blueprints.py","line":54,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 55: def my_decorator_exception_handler(e):","file":"tests/test_blueprints.py","line":55,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"키 에러 테스트 케이스 추가","query":"key error test","file":"tests/test_user_error_handler.py","symbol":"key_error","line":48,"lang":"ko","candidates":[{"text":"File: tests/test_appctx.py\nLine 153: with pytest.raises(KeyError):","file":"tests/test_appctx.py","line":153,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1058: def test_trap_bad_request_key_error(app, client, debug, trap, expect_key, expect_abort):","file":"tests/test_basic.py","line":1058,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1075: with pytest.raises(KeyError) as exc_info:","file":"tests/test_basic.py","line":1075,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1138: with pytest.raises(DebugFilesKeyError) as e:","file":"tests/test_basic.py","line":1138,"lexical":0.65,"target":false},{"text":"File: tests/test_json_tag.py\nLine 37: pytest.raises(KeyError, s.register, TagDict)","file":"tests/test_json_tag.py","line":37,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Je cherche la section qui liste les décorateurs applicables aux vues, afin de comprendre comment modifier le comportement des réponses HTTP.","query":"view decorators","file":"docs/views.rst","symbol":"View Decorators","line":160,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 1409: - Added ``View.decorators`` to support simpler decorating of pluggable","file":"CHANGES.rst","line":1409,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 661: decorators that want to customize the ``OPTIONS`` response on a per-view","file":"docs/api.rst","line":661,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/async-await.rst\nLine 90: If they provide decorators to add functionality to views, those will probably","file":"docs/async-await.rst","line":90,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/index.rst\nLine 26: viewdecorators","file":"docs/patterns/index.rst","line":26,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 1: View Decorators","file":"docs/patterns/viewdecorators.rst","line":1,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/views.rst\nLine 160: View Decorators","file":"docs/views.rst","line":160,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/views.rst\nLine 163: The view class itself is not the view function. View decorators need to","file":"docs/views.rst","line":163,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/views.rst\nLine 165: itself. Set :attr:`View.decorators` to a list of decorators to apply.","file":"docs/views.rst","line":165,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/views.py\nLine 41: the generated view function. Decorators applied to the class itself","file":"src/flask/views.py","line":41,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/views.py\nLine 58: #: A list of decorators to apply, in order, to the generated view","file":"src/flask/views.py","line":58,"lexical":0.6000000000000001,"target":false},{"text":"File: tests/test_views.py\nLine 80: def test_view_decorators(app, client):","file":"tests/test_views.py","line":80,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"How do I use the utility for making simulated requests to the application in my tests?","query":"test client","file":"docs/api.rst","symbol":"Test Client","line":124,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 31: - Fix parsing IPv6 with port in ``run`` and the test client. :pr:`6096`","file":"CHANGES.rst","line":31,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 50: - When using ``follow_redirects`` in the test client, the final state","file":"CHANGES.rst","line":50,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 447: - The test client's ``as_tuple`` parameter is removed. Use","file":"CHANGES.rst","line":447,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 494: - The test client's ``as_tuple`` parameter is deprecated and will be","file":"CHANGES.rst","line":494,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 769: - When using the test client as a context manager (``with client:``),","file":"CHANGES.rst","line":769,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 818: - Passing the ``json`` argument to ``app.test_client`` does not","file":"CHANGES.rst","line":818,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 928: - Add ``json`` keyword argument for the test client request methods.","file":"CHANGES.rst","line":928,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 960: ``test_client.open``. :pr:`2412`","file":"CHANGES.rst","line":960,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 964: - When passing a full URL to the test client, the scheme in the URL is","file":"CHANGES.rst","line":964,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1078: - ``app.test_client`` includes preset default environment, which can","file":"CHANGES.rst","line":1078,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1100: - Added ``**kwargs`` to ``Flask.test_client`` to support passing","file":"CHANGES.rst","line":1100,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1102: ``Flask.test_client_class``.","file":"CHANGES.rst","line":1102,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1177: in the test client when absolute URLs were requested.","file":"CHANGES.rst","line":1177,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1404: - Implemented ``TestClient.session_transaction`` to easily modify","file":"CHANGES.rst","line":1404,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1406: - Refactored test client internally. The ``APPLICATION_ROOT``","file":"CHANGES.rst","line":1406,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1408: used by the test client as defaults.","file":"CHANGES.rst","line":1408,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1411: - Fixed an issue where the test client if used with the \"with\"","file":"CHANGES.rst","line":1411,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1419: of Flask itself and no longer of the test client. This cleaned up","file":"CHANGES.rst","line":1419,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1603: - Test client has not the ability to preserve the request context for","file":"CHANGES.rst","line":1603,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 124: Test Client","file":"docs/api.rst","line":124,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/api.rst\nLine 482: c = app.test_client()","file":"docs/api.rst","line":482,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/appcontext.rst\nLine 95: The primary way to solve this is to use :meth:`.Flask.test_client` to simulate","file":"docs/appcontext.rst","line":95,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/signals.rst\nLine 59: This can now easily be paired with a test client::","file":"docs/signals.rst","line":59,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/signals.rst\nLine 62: rv = app.test_client().get('/')","file":"docs/signals.rst","line":62,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 41: test client, and CLI runner are shown below, they can be placed in","file":"docs/testing.rst","line":41,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 75: return app.test_client()","file":"docs/testing.rst","line":75,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 83: Sending Requests with the Test Client","file":"docs/testing.rst","line":83,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 86: The test client makes requests to the application without running a live","file":"docs/testing.rst","line":86,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 88: :doc:`Werkzeug's client `, see those docs for additional","file":"docs/testing.rst","line":88,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 106: def test_request_example(client):","file":"docs/testing.rst","line":106,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 143: def test_edit_user(client):","file":"docs/testing.rst","line":143,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 163: def test_json_data(client):","file":"docs/testing.rst","line":163,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"Reportar que se está intentando renderizar un archivo HTML que no existe en la aplicación de frontend, lo cual provoca un error al intentar cargar la vista.","query":"render missing template","file":"tests/test_apps/blueprintapp/apps/frontend/__init__.py","symbol":"missing_template","line":13,"lang":"es","candidates":[{"text":"File: tests/test_apps/blueprintapp/apps/frontend/__init__.py\nLine 14: return render_template(\"missing_template.html\")","file":"tests/test_apps/blueprintapp/apps/frontend/__init__.py","line":14,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 214: flask.render_template(\"missing.html\")","file":"tests/test_blueprints.py","line":214,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"テストコード内で、HTTPメソッドの削除アクションをシミュレートして文字列を返す処理はどこにある?","query":"return \"DELETE\"","file":"tests/test_views.py","symbol":"delete","line":224,"lang":"ja","candidates":[{"text":"File: docs/tutorial/blog.rst\nLine 294: ","file":"docs/tutorial/blog.rst","line":294,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/templates/blog/update.html\nLine 17: ","file":"examples/tutorial/flaskr/templates/blog/update.html","line":17,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 333: return self._method_route(\"DELETE\", rule, options)","file":"src/flask/sansio/scaffold.py","line":333,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 72: return \"DELETE\"","file":"tests/test_views.py","line":72,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_views.py\nLine 225: return \"DELETE\"","file":"tests/test_views.py","line":225,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"テスト用のクライアントを作成するメソッドの使い方は?","query":"create test client","file":"src/flask/app.py","symbol":"test_client","line":758,"lang":"ja","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 122: object created by the ``app`` fixture. Tests will use the client to make","file":"docs/tutorial/tests.rst","line":122,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 442: def test_create(client, auth, app):","file":"docs/tutorial/tests.rst","line":442,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 468: def test_create_update_validate(client, auth, path):","file":"docs/tutorial/tests.rst","line":468,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/test_blog.py\nLine 46: def test_create(client, auth, app):","file":"examples/tutorial/tests/test_blog.py","line":46,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/test_blog.py\nLine 69: def test_create_update_validate(client, auth, path):","file":"examples/tutorial/tests/test_blog.py","line":69,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 759: \"\"\"Creates a test client for this application. For information","file":"src/flask/app.py","line":759,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 262: #: The :meth:`test_client` method creates an instance of this test","file":"src/flask/sansio/app.py","line":262,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 691: # Create new test client on each test to clean flashed messages.","file":"tests/test_basic.py","line":691,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"프로덕션 환경에 리플라이를 배포하는 방법을 설명해 줘. 관련 단계를 단계별로 알려줘.","query":"deploy production","file":"docs/tutorial/deploy.rst","symbol":"Deploy to Production","line":1,"lang":"ko","candidates":[{"text":"File: docs/cli.rst\nLine 81: stable, or efficient. See :doc:`/deploying/index` for how to run in production.","file":"docs/cli.rst","line":81,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 76: **Do not enable debug mode when deploying in production.**","file":"docs/config.rst","line":76,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/index.rst\nLine 1: Deploying to Production","file":"docs/deploying/index.rst","line":1,"lexical":0.5,"target":false},{"text":"File: docs/deploying/index.rst\nLine 13: deploying to production. It is intended for use only during local","file":"docs/deploying/index.rst","line":13,"lexical":0.5,"target":false},{"text":"File: docs/gevent.rst\nLine 35: When deploying in production, use :doc:`/deploying/gunicorn` or","file":"docs/gevent.rst","line":35,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/server.rst\nLine 12: Do not use the development server when deploying to production. It","file":"docs/server.rst","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 1: Deploy to Production","file":"docs/tutorial/deploy.rst","line":1,"lexical":0.6000000000000001,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 556: **Do not enable debug mode when deploying in production.**","file":"src/flask/sansio/app.py","line":556,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"요청 URL이랑 매칭된 엔드포인트 이름 가져오는 메서드 어디 있어?","query":"request endpoint","file":"src/flask/wrappers.py","symbol":"endpoint","line":147,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 640: ``request.endpoint``. :issue:`3776`","file":"CHANGES.rst","line":640,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 53: blueprints when dispatching requests and generating URLs from one endpoint","file":"docs/blueprints.rst","line":53,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 145: template_name = f\"{request.endpoint.replace('.', '/')}.html\"","file":"docs/patterns/viewdecorators.rst","line":145,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1166: # If the endpoint starts with \".\" and the request matches a","file":"src/flask/app.py","line":1166,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1311: f\"The view function for {request.endpoint!r} did not\"","file":"src/flask/app.py","line":1311,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 970: # passed endpoint instead of using request.blueprints.","file":"src/flask/sansio/app.py","line":970,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/wrappers.py\nLine 148: \"\"\"The endpoint that matched the request URL.","file":"src/flask/wrappers.py","line":148,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_basic.py\nLine 1747: return flask.request.endpoint","file":"tests/test_basic.py","line":1747,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1751: return flask.request.endpoint","file":"tests/test_basic.py","line":1751,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1755: return flask.request.endpoint","file":"tests/test_basic.py","line":1755,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 288: return flask.request.endpoint","file":"tests/test_blueprints.py","line":288,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 292: return flask.request.endpoint","file":"tests/test_blueprints.py","line":292,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 296: return flask.request.endpoint","file":"tests/test_blueprints.py","line":296,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 300: return flask.request.endpoint","file":"tests/test_blueprints.py","line":300,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 306: return flask.request.endpoint","file":"tests/test_blueprints.py","line":306,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 342: return flask.request.endpoint","file":"tests/test_blueprints.py","line":342,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1092: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1092,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1104: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1104,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_session_interface.py\nLine 7: \"\"\"If request.endpoint (or other URL matching behavior) is needed","file":"tests/test_session_interface.py","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_session_interface.py\nLine 18: assert request.endpoint is not None","file":"tests/test_session_interface.py","line":18,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"find where the error is added to the list during teardown","query":"cleanup exception append","file":"tests/test_appctx.py","symbol":"cleanup","line":81,"lang":"en","candidates":[{"text":"File: tests/test_appctx.py\nLine 51: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":51,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_appctx.py\nLine 64: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":64,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 82: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":82,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 99: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":99,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 122: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":122,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"PERMANENT_SESSION_LIFETIME を 42 に設定したとき、permanent_session_lifetime.seconds が 42 になることを確認するテストを書いてください。","query":"session lifetime config","file":"tests/test_config.py","symbol":"test_session_lifetime","line":211,"lang":"ja","candidates":[{"text":"File: docs/api.rst\nLine 119: The :data:`PERMANENT_SESSION_LIFETIME` config can be an integer or ``timedelta``.","file":"docs/api.rst","line":119,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 220: #: ``PERMANENT_SESSION_LIFETIME`` configuration key. Defaults to","file":"src/flask/sansio/app.py","line":220,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 222: permanent_session_lifetime = ConfigAttribute[timedelta](","file":"src/flask/sansio/app.py","line":222,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_config.py\nLine 213: app.config[\"PERMANENT_SESSION_LIFETIME\"] = 42","file":"tests/test_config.py","line":213,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"テンプレートエンジンにカスタムフィルタを登録するためのデコレータを見つけたい。ビュー関数のデコレータと似たように、名前でフィルタをフラスクアプリに登録する機能。","query":"template filter decorator","file":"src/flask/sansio/blueprints.py","symbol":"app_template_filter","line":446,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1312: - Blueprints now have a decorator to add custom template filters","file":"CHANGES.rst","line":1312,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 692: def decorator(f: T_template_filter) -> T_template_filter:","file":"src/flask/sansio/app.py","line":692,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 704: The :meth:`template_filter` decorator can be used to register a function","file":"src/flask/sansio/app.py","line":704,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 469: def decorator(f: T_template_filter) -> T_template_filter:","file":"src/flask/sansio/blueprints.py","line":469,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 481: The :meth:`app_template_filter` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":481,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"zeige das beispielprojekt für die webanwendung","query":"flask tutorial example","file":"examples/tutorial/README.rst","symbol":"Flaskr","line":1,"lang":"de","candidates":[{"text":"File: docs/tutorial/index.rst\nLine 60: :gh:`The tutorial project is available as an example in the Flask","file":"docs/tutorial/index.rst","line":60,"lexical":0.55,"target":false},{"text":"File: docs/tutorial/static.rst\nLine 56: :gh:`example code `.","file":"docs/tutorial/static.rst","line":56,"lexical":0.55,"target":false}]} {"site":"project_search","repo":"flask","task":"環境変数から特定の接頭辞を持つ設定を読み込む機能のテストコードを探しています。文字列や数値、リストなどの型変換が正しく行われるかを確認したいです。","query":"from_prefixed_env test","file":"tests/test_config.py","symbol":"test_from_prefixed_env","line":48,"lang":"ja","candidates":[{"text":"File: tests/test_config.py\nLine 48: def test_from_prefixed_env(monkeypatch):","file":"tests/test_config.py","line":48,"lexical":0.6000000000000001,"target":true},{"text":"File: tests/test_config.py\nLine 69: def test_from_prefixed_env_custom_prefix(monkeypatch):","file":"tests/test_config.py","line":69,"lexical":0.6000000000000001,"target":false},{"text":"File: tests/test_config.py\nLine 79: def test_from_prefixed_env_nested(monkeypatch):","file":"tests/test_config.py","line":79,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"这里的静态资源是怎么配置的?","query":"static files","file":"docs/tutorial/static.rst","symbol":"Static Files","line":1,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 1338: hook for subclasses to override behavior of serving static files","file":"CHANGES.rst","line":1338,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1343: and static files can be configured through a new","file":"CHANGES.rst","line":1343,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 583: This is consistent with how web servers deal with static files. This","file":"docs/api.rst","line":583,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 29: * Provide template filters, static files, templates, and other utilities","file":"docs/blueprints.rst","line":29,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 191: Static Files","file":"docs/blueprints.rst","line":191,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 194: A blueprint can expose a folder with static files by providing the path","file":"docs/blueprints.rst","line":194,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 195: to the folder on the filesystem with the ``static_folder`` argument.","file":"docs/blueprints.rst","line":195,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 227: For static files, the path can be absolute or relative to the blueprint","file":"docs/blueprints.rst","line":227,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/design.rst\nLine 58: then access the package to figure out where the templates and static files","file":"docs/design.rst","line":58,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 107: There are other middleware that can handle serving static files, authentication, etc.","file":"docs/lifecycle.rst","line":107,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 31: as templates and static files.","file":"docs/quickstart.rst","line":31,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 335: Static Files","file":"docs/quickstart.rst","line":335,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 338: Dynamic web applications also need static files. That's usually where","file":"docs/quickstart.rst","line":338,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 344: To generate URLs for static files, use the special ``'static'`` endpoint name::","file":"docs/quickstart.rst","line":344,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 348: The file has to be stored on the filesystem as :file:`static/style.css`.","file":"docs/quickstart.rst","line":348,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/static.rst\nLine 1: Static Files","file":"docs/tutorial/static.rst","line":1,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/tutorial/static.rst\nLine 17: Besides CSS, other types of static files might be files with JavaScript","file":"docs/tutorial/static.rst","line":17,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/templates.rst\nLine 13: Templates are files that contain static data as well as placeholders","file":"docs/tutorial/templates.rst","line":13,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 178: static files on the web. Defaults to the name","file":"src/flask/app.py","line":178,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 180: :param static_folder: The folder with static files that is served at","file":"src/flask/app.py","line":180,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 351: # development). Also, Google App Engine stores static files somewhere","file":"src/flask/app.py","line":351,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 406: raise RuntimeError(\"'static_folder' must be set to serve static_files.\")","file":"src/flask/app.py","line":406,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/blueprints.py\nLine 95: raise RuntimeError(\"'static_folder' must be set to serve static_files.\")","file":"src/flask/blueprints.py","line":95,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/helpers.py\nLine 558: This is a secure way to serve files from a folder, such as static","file":"src/flask/helpers.py","line":558,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 127: static files on the web. Defaults to the name","file":"src/flask/sansio/app.py","line":127,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 129: :param static_folder: The folder with static files that is served at","file":"src/flask/sansio/app.py","line":129,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 140: :param static_folder: A folder with static files that should be","file":"src/flask/sansio/blueprints.py","line":140,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 142: the blueprint's root path. Blueprint static files are disabled","file":"src/flask/sansio/blueprints.py","line":142,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 144: :param static_url_path: The url to serve static files from.","file":"src/flask/sansio/blueprints.py","line":144,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 147: and the blueprint's static files won't be accessible.","file":"src/flask/sansio/blueprints.py","line":147,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 58: :param static_folder: Path to a folder of static files to serve.","file":"src/flask/sansio/scaffold.py","line":58,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 63: :param root_path: The path that static, template, and resource files","file":"src/flask/sansio/scaffold.py","line":63,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Estoy configurando las pruebas de integración para las rutas de la API. ¿Dónde puedo encontrar un recurso que simule una respuesta de streaming para probar cómo se manejan los argumentos de la URL?","query":"stream flask response","file":"tests/test_helpers.py","symbol":"index","line":231,"lang":"es","candidates":[{"text":"File: src/flask/helpers.py\nLine 87: from flask import stream_with_context, request, Response","file":"src/flask/helpers.py","line":87,"lexical":0.55,"target":false},{"text":"File: src/flask/helpers.py\nLine 103: from flask import stream_with_context, request, Response","file":"src/flask/helpers.py","line":103,"lexical":0.55,"target":false},{"text":"File: tests/test_helpers.py\nLine 237: return flask.Response(flask.stream_with_context(generate()))","file":"tests/test_helpers.py","line":237,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_helpers.py\nLine 281: return flask.Response(flask.stream_with_context(Wrapper(generate())))","file":"tests/test_helpers.py","line":281,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Ich bin gerade dabei, die Anleitung für die Erstinstallation aufzusetzen. Wo finde ich die Informationen dazu, wie man den Schlüssel für die Verschlüsselung einrichtet?","query":"configure secret key","file":"docs/tutorial/deploy.rst","symbol":"Configure the Secret Key","line":51,"lang":"de","candidates":[{"text":"File: docs/api.rst\nLine 56: If you have set :attr:`Flask.secret_key` (or configured it from","file":"docs/api.rst","line":56,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 51: Configure the Secret Key","file":"docs/tutorial/deploy.rst","line":51,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"デバッグモードを有効にした際、テンプレートの自動リロード設定が連動して更新されない、または意図しない挙動になる問題があります。設定値の変更がテンプレートエンジンのリロード設定にどう影響するかを確認してください。","query":"debug auto reload","file":"src/flask/sansio/app.py","symbol":"debug","line":563,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 940: - Template auto reloading will honor debug mode even if","file":"CHANGES.rst","line":940,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1115: - Templates are no longer automatically reloaded outside of debug","file":"CHANGES.rst","line":1115,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 91: server. By enabling debug mode, the server will automatically reload if","file":"docs/quickstart.rst","line":91,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 491: auto_reload = self.debug","file":"src/flask/app.py","line":491,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 647: If the :attr:`debug` flag is set the server will automatically reload","file":"src/flask/app.py","line":647,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 475: def test_templates_auto_reload_debug_run(app, monkeypatch):","file":"tests/test_templating.py","line":475,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Estou tentando entender por que essa dependência específica de correção de erros de digitação está listada aqui. Você pode verificar se ela é estritamente necessária para o processamento das tarefas assíncronas?","query":"click-didyoumean","file":"examples/celery/requirements.txt","symbol":"click-didyoumean","line":24,"lang":"pt","candidates":[{"text":"File: examples/celery/requirements.txt\nLine 20: # click-didyoumean","file":"examples/celery/requirements.txt","line":20,"lexical":0.35,"target":true},{"text":"File: examples/celery/requirements.txt\nLine 24: click-didyoumean==0.3.0","file":"examples/celery/requirements.txt","line":24,"lexical":0.35,"target":false}]} {"site":"project_search","repo":"flask","task":"Wo finde ich die Definitionen für die Objekte, die als Bauplan für die Konfiguration dienen?","query":"blueprint objects","file":"docs/api.rst","symbol":"Blueprint Objects","line":19,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 1232: objects will not be available and blueprint's context processors are","file":"CHANGES.rst","line":1232,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 19: Blueprint Objects","file":"docs/api.rst","line":19,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/lifecycle.rst\nLine 51: general, don't do anything to modify the ``Flask`` app object and ``Blueprint`` objects","file":"docs/lifecycle.rst","line":51,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 368: #: Maps registered blueprint names to blueprint objects. The","file":"src/flask/sansio/app.py","line":368,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 486: This is available on both app and blueprint objects. When used on an app, this","file":"src/flask/sansio/scaffold.py","line":486,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 507: This is available on both app and blueprint objects. When used on an app, this","file":"src/flask/sansio/scaffold.py","line":507,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 541: This is available on both app and blueprint objects. When used on an app, this","file":"src/flask/sansio/scaffold.py","line":541,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 558: This is available on both app and blueprint objects. When used on an app, this","file":"src/flask/sansio/scaffold.py","line":558,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 583: This is available on both app and blueprint objects. When used on an app, this","file":"src/flask/sansio/scaffold.py","line":583,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 597: This is available on both app and blueprint objects. When used on an app, this","file":"src/flask/sansio/scaffold.py","line":597,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 624: This is available on both app and blueprint objects. When used on an app, this","file":"src/flask/sansio/scaffold.py","line":624,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"finde die exception für verbotene unterklassenregistrierung","query":"forbidden subclass registered","file":"tests/test_user_error_handler.py","symbol":"ForbiddenSubclassRegistered","line":101,"lang":"de","candidates":[{"text":"File: tests/test_user_error_handler.py\nLine 101: class ForbiddenSubclassRegistered(Forbidden):","file":"tests/test_user_error_handler.py","line":101,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 104: class ForbiddenSubclassUnregistered(Forbidden):","file":"tests/test_user_error_handler.py","line":104,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 112: @app.errorhandler(ForbiddenSubclassRegistered)","file":"tests/test_user_error_handler.py","line":112,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 114: assert isinstance(e, ForbiddenSubclassRegistered)","file":"tests/test_user_error_handler.py","line":114,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 123: raise ForbiddenSubclassRegistered()","file":"tests/test_user_error_handler.py","line":123,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 127: raise ForbiddenSubclassUnregistered()","file":"tests/test_user_error_handler.py","line":127,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"erstelle eine testklasse mit einem konfigurierten geheimen schlüsselwert","query":"test config secret","file":"tests/test_config.py","symbol":"Test","line":136,"lang":"de","candidates":[{"text":"File: tests/test_config.py\nLine 112: app.config.from_mapping({\"SECRET_KEY\": \"config\", \"TEST_KEY\": \"foo\"})","file":"tests/test_config.py","line":112,"lexical":0.65,"target":true},{"text":"File: tests/test_config.py\nLine 116: app.config.from_mapping([(\"SECRET_KEY\", \"config\"), (\"TEST_KEY\", \"foo\")])","file":"tests/test_config.py","line":116,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 120: app.config.from_mapping(SECRET_KEY=\"config\", TEST_KEY=\"foo\")","file":"tests/test_config.py","line":120,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 124: app.config.from_mapping(SECRET_KEY=\"config\", TEST_KEY=\"foo\", skip_key=\"skip\")","file":"tests/test_config.py","line":124,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"这个把对象转成 JSON 字符串的方法是怎么判断调用哪个 provider 的?","query":"serialize to json","file":"src/flask/json/__init__.py","symbol":"dumps","line":13,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 923: - Allow registering new tags with ``TaggedJSONSerializer`` to support","file":"CHANGES.rst","line":923,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 209: dict from the view. It will be serialized to JSON automatically.","file":"docs/patterns/javascript.rst","line":209,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 224: with the given data serialized to JSON.","file":"docs/patterns/javascript.rst","line":224,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/web-security.rst\nLine 143: In Flask 0.10 and lower, :func:`~flask.jsonify` did not serialize top-level","file":"docs/web-security.rst","line":143,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/json/__init__.py\nLine 48: \"\"\"Serialize data as JSON and write to a file.","file":"src/flask/json/__init__.py","line":48,"lexical":0.55,"target":true},{"text":"File: src/flask/json/provider.py\nLine 50: \"\"\"Serialize data as JSON and write to a file.","file":"src/flask/json/provider.py","line":50,"lexical":0.55,"target":false},{"text":"File: src/flask/json/provider.py\nLine 140: not know how to serialize. It should return a valid JSON type or","file":"src/flask/json/provider.py","line":140,"lexical":0.55,"target":false},{"text":"File: src/flask/json/provider.py\nLine 167: \"\"\"Serialize data as JSON to a string.","file":"src/flask/json/provider.py","line":167,"lexical":0.55,"target":false},{"text":"File: src/flask/json/tag.py\nLine 10: .. autoclass:: TaggedJSONSerializer","file":"src/flask/json/tag.py","line":10,"lexical":0.55,"target":false},{"text":"File: src/flask/json/tag.py\nLine 221: are not JSON types. Passed as the intermediate serializer to","file":"src/flask/json/tag.py","line":221,"lexical":0.55,"target":false},{"text":"File: src/flask/testing.py\nLine 89: \"\"\"Serialize ``obj`` to a JSON-formatted string.","file":"src/flask/testing.py","line":89,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"How is the string representation formatted for this context object, especially when a request is present?","query":"repr context request","file":"src/flask/ctx.py","symbol":"__repr__","line":518,"lang":"en","candidates":[{"text":"File: src/flask/app.py\nLine 1369: def preprocess_request(self, ctx: AppContext) -> ft.ResponseReturnValue | None:","file":"src/flask/app.py","line":1369,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1505: \"\"\"Create an :class:`.AppContext` with request information representing","file":"src/flask/app.py","line":1505,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 282: :param request: The request data this context represents.","file":"src/flask/ctx.py","line":282,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/ctx.py\nLine 344: :param environ: The request data this context represents.","file":"src/flask/ctx.py","line":344,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"task","query":"render template filter","file":"tests/test_templating.py","symbol":"index","line":207,"lang":"en","candidates":[{"text":"File: tests/test_blueprints.py\nLine 437: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_blueprints.py","line":437,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 446: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_blueprints.py","line":446,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 470: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_blueprints.py","line":470,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 487: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_blueprints.py","line":487,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 504: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_blueprints.py","line":504,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 194: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_templating.py","line":194,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_templating.py\nLine 208: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_templating.py","line":208,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 221: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_templating.py","line":221,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 235: return flask.render_template(\"template_filter.html\", value=\"abcd\")","file":"tests/test_templating.py","line":235,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"테스트용 상위 예외 클래스가 필요해.","query":"parent exception","file":"tests/test_user_error_handler.py","symbol":"ParentException","line":62,"lang":"ko","candidates":[{"text":"File: docs/blueprints.rst\nLine 158: handler that can handle a given exception, the parent's will be tried.","file":"docs/blueprints.rst","line":158,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 62: class ParentException(Exception):","file":"tests/test_user_error_handler.py","line":62,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 65: class ChildExceptionUnregistered(ParentException):","file":"tests/test_user_error_handler.py","line":65,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 68: class ChildExceptionRegistered(ParentException):","file":"tests/test_user_error_handler.py","line":68,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 71: @app.errorhandler(ParentException)","file":"tests/test_user_error_handler.py","line":71,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 72: def parent_exception_handler(e):","file":"tests/test_user_error_handler.py","line":72,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 73: assert isinstance(e, ParentException)","file":"tests/test_user_error_handler.py","line":73,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 83: raise ParentException()","file":"tests/test_user_error_handler.py","line":83,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Necesito encontrar la clase base que define el contrato para implementar una gestión de persistencia de datos de usuario personalizada, específicamente la que dicta cómo se deben abrir y guardar los datos de la sesión para que sean compatibles con el framework.","query":"session interface","file":"src/flask/sessions.py","symbol":"SessionInterface","line":100,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 362: - ``SessionInterface.get_expiration_time`` uses a timezone-aware","file":"CHANGES.rst","line":362,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 592: - Add ``SessionInterface.get_cookie_name`` to allow setting the","file":"CHANGES.rst","line":592,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 639: This could allow a session interface to change behavior based on","file":"CHANGES.rst","line":639,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1376: - Refactored session support into a session interface so that the","file":"CHANGES.rst","line":1376,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 92: Session Interface","file":"docs/api.rst","line":92,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 97: The session interface provides a simple way to replace the session","file":"docs/api.rst","line":97,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 102: .. autoclass:: SessionInterface","file":"docs/api.rst","line":102,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 105: .. autoclass:: SecureCookieSessionInterface","file":"docs/api.rst","line":105,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 59: - Setting a session interface, instead of the default itsdangerous cookie.","file":"docs/lifecycle.rst","line":59,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 146: :attr:`~.Flask.session_interface`.","file":"docs/lifecycle.rst","line":146,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 46: from .sessions import SecureCookieSessionInterface","file":"src/flask/app.py","line":46,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 47: from .sessions import SessionInterface","file":"src/flask/app.py","line":47,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 249: #: the session interface to use. By default an instance of","file":"src/flask/app.py","line":249,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 250: #: :class:`~flask.sessions.SecureCookieSessionInterface` is used here.","file":"src/flask/app.py","line":250,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 253: session_interface: SessionInterface = SecureCookieSessionInterface()","file":"src/flask/app.py","line":253,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1418: if not self.session_interface.is_null_session(ctx._get_session()):","file":"src/flask/app.py","line":1418,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1419: self.session_interface.save_session(self, ctx._get_session(), response)","file":"src/flask/app.py","line":1419,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/ctx.py\nLine 387: si = self.app.session_interface","file":"src/flask/ctx.py","line":387,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/json/tag.py\nLine 6: types. :class:`~flask.sessions.SecureCookieSessionInterface` uses this","file":"src/flask/json/tag.py","line":6,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/json/tag.py\nLine 41: app.session_interface.serializer.register(TagOrderedDict, index=0)","file":"src/flask/json/tag.py","line":41,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sessions.py\nLine 100: class SessionInterface:","file":"src/flask/sessions.py","line":100,"lexical":0.6000000000000001,"target":true},{"text":"File: src/flask/sessions.py\nLine 102: default session interface which uses werkzeug's securecookie","file":"src/flask/sessions.py","line":102,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 121: To replace the session interface on an application all you have to do","file":"src/flask/sessions.py","line":121,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 122: is to assign :attr:`flask.Flask.session_interface`::","file":"src/flask/sessions.py","line":122,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 125: app.session_interface = MySessionInterface()","file":"src/flask/sessions.py","line":125,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 128: concurrently. When implementing a new session interface, consider","file":"src/flask/sessions.py","line":128,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 143: #: A flag that indicates if the session interface is pickle based.","file":"src/flask/sessions.py","line":143,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 254: interface as well as the :class:`SessionMixin` interface.","file":"src/flask/sessions.py","line":254,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 284: class SecureCookieSessionInterface(SessionInterface):","file":"src/flask/sessions.py","line":284,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sessions.py\nLine 285: \"\"\"The default session interface that stores sessions in signed cookies","file":"src/flask/sessions.py","line":285,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/testing.py\nLine 165: sess = app.session_interface.open_session(app, ctx.request)","file":"src/flask/testing.py","line":165,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/testing.py\nLine 173: if app.session_interface.is_null_session(sess):","file":"src/flask/testing.py","line":173,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"查找通过环境变量加载配置文件并能处理异常的方法","query":"env load config","file":"src/flask/config.py","symbol":"from_envvar","line":102,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 483: - Add ``Config.from_prefixed_env()`` to load config values from","file":"CHANGES.rst","line":483,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 606: the ``loads`` argument of :meth:`~flask.Config.from_prefixed_env`.","file":"docs/config.rst","line":606,"lexical":0.65,"target":false},{"text":"File: src/flask/config.py\nLine 103: \"\"\"Loads a configuration from an environment variable pointing to","file":"src/flask/config.py","line":103,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"Como posso garantir que o contexto do objeto request seja preservado ao executa uma função em uma thread separada usando o executor?","query":"flask copy request context","file":"tests/test_reqctx.py","symbol":"index","line":155,"lang":"pt","candidates":[{"text":"File: src/flask/ctx.py\nLine 178: from flask import copy_current_request_context","file":"src/flask/ctx.py","line":178,"lexical":0.6000000000000001,"target":false},{"text":"File: tests/test_reqctx.py\nLine 158: @flask.copy_current_request_context","file":"tests/test_reqctx.py","line":158,"lexical":0.5,"target":true}]} {"site":"project_search","repo":"flask","task":"I'm debugging an issue where request context attributes aren't being initialized automatically. Can you show me how the context object handles setting a default value for an attribute if it doesn't already exist?","query":"context setdefault","file":"src/flask/ctx.py","symbol":"setdefault","line":93,"lang":"en","candidates":[{"text":"File: src/flask/cli.py\nLine 585: extra[\"context_settings\"].setdefault(\"auto_envvar_prefix\", \"FLASK\")","file":"src/flask/cli.py","line":585,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 651: lambda s: s.app.template_context_processors.setdefault(None, []).append(f)","file":"src/flask/sansio/blueprints.py","line":651,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"trouve la méthode qui renvoie la méthode http de récupération","query":"return \"GET\"","file":"tests/test_views.py","symbol":"get","line":168,"lang":"fr","candidates":[{"text":"File: src/flask/sansio/scaffold.py\nLine 301: return self._method_route(\"GET\", rule, options)","file":"src/flask/sansio/scaffold.py","line":301,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_async.py\nLine 33: return \"GET\"","file":"tests/test_async.py","line":33,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 31: return \"GET\"","file":"tests/test_views.py","line":31,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_views.py\nLine 51: return \"GET\"","file":"tests/test_views.py","line":51,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 65: return \"GET\"","file":"tests/test_views.py","line":65,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 169: return \"GET\"","file":"tests/test_views.py","line":169,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 206: return \"GET\"","file":"tests/test_views.py","line":206,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 221: return \"GET\"","file":"tests/test_views.py","line":221,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 240: return \"GET\"","file":"tests/test_views.py","line":240,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"API 응답 과정에서 특정 HTTP 상태 코드를 반환하며 요청을 중단시키는 로직이 어디에 정의되어 있는지 확인하고 싶습니다. 사용자 정의 에러 핸들러를 거쳐 예외를 발생시키는 흐름을 찾고 있어요.","query":"raise http exception","file":"src/flask/helpers.py","symbol":"abort","line":281,"lang":"ko","candidates":[{"text":"File: docs/config.rst\nLine 98: If there is no handler for an ``HTTPException``-type exception, re-raise it","file":"docs/config.rst","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 153: Flask gives you the ability to raise any HTTP exception registered by","file":"docs/errorhandling.rst","line":153,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 217: :func:`abort` will raise a special exception that returns an HTTP status","file":"docs/tutorial/blog.rst","line":217,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 282: \"\"\"Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given","file":"src/flask/helpers.py","line":282,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 899: This is called for all HTTP exceptions raised by a view function.","file":"src/flask/sansio/app.py","line":899,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"在测试用例中发现一个用于模拟特定时区偏移量的类,该类通过指定小时数来定义相对于 UTC 的固定时间差,并允许自定义时区名称,请确认其实现逻辑是否符合预期的时区行为。","query":"fixed hour offset","file":"tests/test_json.py","symbol":"FixedOffset","line":145,"lang":"zh","candidates":[{"text":"File: tests/test_json.py\nLine 146: \"\"\"Fixed offset in hours east from UTC.","file":"tests/test_json.py","line":146,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_json.py\nLine 169: tzinfo = FixedOffset(hours=tz[1], name=tz[0])","file":"tests/test_json.py","line":169,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_json.py\nLine 171: gmt = FixedOffset(hours=0, name=\"GMT\")","file":"tests/test_json.py","line":171,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"测试使用非标准前缀加载环境变量的行为","query":"test prefixed env prefix","file":"tests/test_config.py","symbol":"test_from_prefixed_env_custom_prefix","line":69,"lang":"zh","candidates":[{"text":"File: tests/test_config.py\nLine 48: def test_from_prefixed_env(monkeypatch):","file":"tests/test_config.py","line":48,"lexical":0.65,"target":true},{"text":"File: tests/test_config.py\nLine 69: def test_from_prefixed_env_custom_prefix(monkeypatch):","file":"tests/test_config.py","line":69,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 79: def test_from_prefixed_env_nested(monkeypatch):","file":"tests/test_config.py","line":79,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Comment récupérer le nom de l'application ou du module parent à partir d'un point d'entrée ?","query":"endpoint blueprint name","file":"src/flask/wrappers.py","symbol":"blueprint","line":162,"lang":"fr","candidates":[{"text":"File: docs/blueprints.rst\nLine 206: The endpoint is named ``blueprint_name.static``. You can generate URLs","file":"docs/blueprints.rst","line":206,"lexical":0.65,"target":false},{"text":"File: docs/blueprints.rst\nLine 270: prefix the URL endpoint with the name of the blueprint and a dot (``.``)::","file":"docs/blueprints.rst","line":270,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1170: endpoint = f\"{blueprint_name}{endpoint}\"","file":"src/flask/app.py","line":1170,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 973: names, reversed(_split_blueprint_path(endpoint.rpartition(\".\")[0]))","file":"src/flask/sansio/app.py","line":973,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 424: The URL rule is prefixed with the blueprint's URL prefix. The endpoint name,","file":"src/flask/sansio/blueprints.py","line":424,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Où est définie l'encodage des caractères pour le projet ?","query":"charset utf-8","file":".editorconfig","symbol":"charset","line":9,"lang":"fr","candidates":[{"text":"File: examples/celery/src/task_app/templates/index.html\nLine 4: ","file":"examples/celery/src/task_app/templates/index.html","line":4,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1158: {\"X-Foo\": \"Testing\", \"Content-Type\": \"text/plain; charset=utf-8\"},","file":"tests/test_basic.py","line":1158,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1163: return \"Hello\", {\"X-Foo\": \"Test\", \"Content-Type\": \"text/plain; charset=utf-8\"}","file":"tests/test_basic.py","line":1163,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"How to return a streamed response with the current application context in Flask?","query":"stream_with_context","file":"tests/test_testing.py","symbol":"index","line":386,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 49: - ``stream_with_context`` does not fail inside async views. :issue:`5774`","file":"CHANGES.rst","line":49,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 377: - ``stream_with_context`` preserves context separately from a","file":"CHANGES.rst","line":377,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 569: - Improve typing for ``stream_with_context``. :issue:`4052`","file":"CHANGES.rst","line":569,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 926: context stack yet. This allows ``stream_with_context`` generators to","file":"CHANGES.rst","line":926,"lexical":0.35,"target":false},{"text":"File: CHANGES.rst\nLine 1357: - Added ``flask.stream_with_context`` and the ability to push contexts","file":"CHANGES.rst","line":1357,"lexical":0.35,"target":false},{"text":"File: docs/api.rst\nLine 288: .. autofunction:: stream_with_context","file":"docs/api.rst","line":288,"lexical":0.35,"target":false},{"text":"File: docs/gevent.rst\nLine 52: spawned function, decorate the function with :func:`.stream_with_context` or","file":"docs/gevent.rst","line":52,"lexical":0.35,"target":false},{"text":"File: docs/patterns/streaming.rst\nLine 72: :func:`.stream_with_context` wrapper. This will keep the request context active","file":"docs/patterns/streaming.rst","line":72,"lexical":0.35,"target":false},{"text":"File: docs/patterns/streaming.rst\nLine 77: from flask import stream_with_context, request","file":"docs/patterns/streaming.rst","line":77,"lexical":0.35,"target":false},{"text":"File: docs/patterns/streaming.rst\nLine 86: return stream_with_context(generate())","file":"docs/patterns/streaming.rst","line":86,"lexical":0.35,"target":false},{"text":"File: docs/patterns/streaming.rst\nLine 92: @stream_with_context","file":"docs/patterns/streaming.rst","line":92,"lexical":0.35,"target":false},{"text":"File: docs/patterns/streaming.rst\nLine 100: use :func:`~flask.stream_with_context` if a request is active.","file":"docs/patterns/streaming.rst","line":100,"lexical":0.35,"target":false},{"text":"File: docs/templating.rst\nLine 254: :func:`~flask.stream_with_context` wrapper if a request is active, so that","file":"docs/templating.rst","line":254,"lexical":0.35,"target":false},{"text":"File: src/flask/__init__.py\nLine 21: from .helpers import stream_with_context as stream_with_context","file":"src/flask/__init__.py","line":21,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 52: def stream_with_context(","file":"src/flask/helpers.py","line":52,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 58: def stream_with_context(","file":"src/flask/helpers.py","line":58,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 63: def stream_with_context(","file":"src/flask/helpers.py","line":63,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 87: from flask import stream_with_context, request, Response","file":"src/flask/helpers.py","line":87,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 91: @stream_with_context","file":"src/flask/helpers.py","line":91,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 103: from flask import stream_with_context, request, Response","file":"src/flask/helpers.py","line":103,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 112: return Response(stream_with_context(generate()))","file":"src/flask/helpers.py","line":112,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 122: return stream_with_context(gen)","file":"src/flask/helpers.py","line":122,"lexical":0.35,"target":false},{"text":"File: src/flask/helpers.py\nLine 129: \"'stream_with_context' can only be used when a request\"","file":"src/flask/helpers.py","line":129,"lexical":0.35,"target":false},{"text":"File: src/flask/templating.py\nLine 12: from .helpers import stream_with_context","file":"src/flask/templating.py","line":12,"lexical":0.35,"target":false},{"text":"File: src/flask/templating.py\nLine 178: return stream_with_context(generate())","file":"src/flask/templating.py","line":178,"lexical":0.35,"target":false},{"text":"File: tests/test_helpers.py\nLine 237: return flask.Response(flask.stream_with_context(generate()))","file":"tests/test_helpers.py","line":237,"lexical":0.35,"target":false},{"text":"File: tests/test_helpers.py\nLine 245: @flask.stream_with_context","file":"tests/test_helpers.py","line":245,"lexical":0.35,"target":false},{"text":"File: tests/test_helpers.py\nLine 281: return flask.Response(flask.stream_with_context(Wrapper(generate())))","file":"tests/test_helpers.py","line":281,"lexical":0.35,"target":false},{"text":"File: tests/test_helpers.py\nLine 292: @flask.stream_with_context","file":"tests/test_helpers.py","line":292,"lexical":0.35,"target":false},{"text":"File: tests/test_helpers.py\nLine 306: @flask.stream_with_context","file":"tests/test_helpers.py","line":306,"lexical":0.35,"target":false},{"text":"File: tests/test_testing.py\nLine 387: # stream_with_context pushes a third context, preserved by response","file":"tests/test_testing.py","line":387,"lexical":0.35,"target":true},{"text":"File: tests/test_testing.py\nLine 388: return flask.stream_with_context(\"hello\")","file":"tests/test_testing.py","line":388,"lexical":0.35,"target":false}]} {"site":"project_search","repo":"flask","task":"設定オブジェクトを生成する処理を探して","query":"make config","file":"src/flask/sansio/app.py","symbol":"make_config","line":479,"lang":"ja","candidates":[{"text":"File: docs/config.rst\nLine 507: in uppercase are actually stored in the config object later on. So make","file":"docs/config.rst","line":507,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/config.rst\nLine 515: Make sure to load the configuration very early on, so that extensions have","file":"docs/config.rst","line":515,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/config.rst\nLine 644: different configurations attached which makes unit testing a lot","file":"docs/config.rst","line":644,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/config.rst\nLine 651: 3. Make sure to load the configuration very early on, so that","file":"docs/config.rst","line":651,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/deploying/mod_wsgi.rst\nLine 5: The modern `mod_wsgi-express`_ command makes it easy to configure and","file":"docs/deploying/mod_wsgi.rst","line":5,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 113: 1. Make it possible to pass in configuration values for unit tests so that","file":"docs/patterns/appfactories.rst","line":113,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/layout.rst\nLine 47: * Version control config, such as `git`_. You should make a habit of","file":"docs/tutorial/layout.rst","line":47,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 493: Some extra configuration, which is not required but makes running tests with coverage","file":"docs/tutorial/tests.rst","line":493,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/config.py\nLine 21: \"\"\"Makes an attribute forward to the config\"\"\"","file":"src/flask/config.py","line":21,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/config.py\nLine 70: only uppercase keys are added to the config. This makes it possible to use","file":"src/flask/config.py","line":70,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/config.py\nLine 121: \" this variable and make it point to a configuration\"","file":"src/flask/config.py","line":121,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 316: self.config = self.make_config(instance_relative_config)","file":"src/flask/sansio/app.py","line":316,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 479: def make_config(self, instance_relative: bool = False) -> Config:","file":"src/flask/sansio/app.py","line":479,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"非同期処理の後にレスポンスを返すデコレータを探して","query":"after sync response","file":"tests/type_check/typing_app_decorators.py","symbol":"after_sync","line":10,"lang":"ja","candidates":[{"text":"File: tests/test_async.py\nLine 115: async def after(response):","file":"tests/test_async.py","line":115,"lexical":0.65,"target":false},{"text":"File: tests/test_async.py\nLine 132: async def bp_after(response):","file":"tests/test_async.py","line":132,"lexical":0.65,"target":false},{"text":"File: tests/type_check/typing_app_decorators.py\nLine 10: def after_sync(response: Response) -> Response:","file":"tests/type_check/typing_app_decorators.py","line":10,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/type_check/typing_app_decorators.py\nLine 15: async def after_async(response: Response) -> Response:","file":"tests/type_check/typing_app_decorators.py","line":15,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"文档里关于部署到不同托管平台的说明在哪里?","query":"hosting platforms","file":"docs/deploying/index.rst","symbol":"Hosting Platforms","line":57,"lang":"zh","candidates":[{"text":"File: docs/deploying/gunicorn.rst\nLine 7: * It tends to integrate easily with hosting platforms.","file":"docs/deploying/gunicorn.rst","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/deploying/index.rst\nLine 57: Hosting Platforms","file":"docs/deploying/index.rst","line":57,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/deploying/proxy_fix.rst\nLine 4: When using a reverse proxy, or many Python hosting platforms, the proxy","file":"docs/deploying/proxy_fix.rst","line":4,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"在处理流式数据时,似乎无法正确传递或保留上下文信息,导致流式输出与当前的运行环境或状态脱节。","query":"streaming context","file":"docs/patterns/streaming.rst","symbol":"Streaming with Context","line":64,"lang":"zh","candidates":[{"text":"File: docs/patterns/streaming.rst\nLine 64: Streaming with Context","file":"docs/patterns/streaming.rst","line":64,"lexical":0.6000000000000001,"target":true},{"text":"File: src/flask/ctx.py\nLine 424: In some situations, such as streaming or testing, the context may be","file":"src/flask/ctx.py","line":424,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 229: def test_streaming_with_context(self, app, client):","file":"tests/test_helpers.py","line":229,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 242: def test_streaming_with_context_as_decorator(self, app, client):","file":"tests/test_helpers.py","line":242,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 256: def test_streaming_with_context_and_custom_close(self, app, client):","file":"tests/test_helpers.py","line":256,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Wie registriert man eine Funktion als Template-Filter innerhalb einer Blaupause?","query":"template filter decorator","file":"src/flask/sansio/blueprints.py","symbol":"decorator","line":469,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1312: - Blueprints now have a decorator to add custom template filters","file":"CHANGES.rst","line":1312,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 692: def decorator(f: T_template_filter) -> T_template_filter:","file":"src/flask/sansio/app.py","line":692,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 704: The :meth:`template_filter` decorator can be used to register a function","file":"src/flask/sansio/app.py","line":704,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 469: def decorator(f: T_template_filter) -> T_template_filter:","file":"src/flask/sansio/blueprints.py","line":469,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 481: The :meth:`app_template_filter` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":481,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Flaskのルーティングを分割するためのクラスの初期化引数の構成を教えて","query":"flask blueprint init","file":"src/flask/blueprints.py","symbol":"Blueprint","line":18,"lang":"ja","candidates":[{"text":"File: tests/test_blueprints.py\nLine 1008: parent = flask.Blueprint(\"parent\", __name__, url_prefix=parent_init)","file":"tests/test_blueprints.py","line":1008,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1009: child = flask.Blueprint(\"child\", __name__, url_prefix=child_init)","file":"tests/test_blueprints.py","line":1009,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"find where session messages are added for the next request display","query":"flash messages session","file":"src/flask/helpers.py","symbol":"flash","line":326,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1489: - Don't modify the session on ``get_flashed_messages`` if there are no","file":"CHANGES.rst","line":1489,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 363: \"\"\"Pulls all flashed messages from the session and returns them.","file":"src/flask/helpers.py","line":363,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"find where the logic for verifying if initialization is complete is defined","query":"check setup finished","file":"src/flask/sansio/scaffold.py","symbol":"_check_setup_finished","line":220,"lang":"en","candidates":[{"text":"File: src/flask/sansio/app.py\nLine 410: def _check_setup_finished(self, f_name: str) -> None:","file":"src/flask/sansio/app.py","line":410,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 213: def _check_setup_finished(self, f_name: str) -> None:","file":"src/flask/sansio/blueprints.py","line":213,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 46: self._check_setup_finished(f_name)","file":"src/flask/sansio/scaffold.py","line":46,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/scaffold.py\nLine 220: def _check_setup_finished(self, f_name: str) -> None:","file":"src/flask/sansio/scaffold.py","line":220,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm trying to find where the main landing page route is defined in the web layer. Can you show me the class that handles the root view and uses that specific parachute decorator?","query":"view dispatch_request","file":"tests/test_views.py","symbol":"Index","line":89,"lang":"en","candidates":[{"text":"File: docs/async-await.rst\nLine 21: coroutines. This applies to the :meth:`~flask.views.View.dispatch_request`","file":"docs/async-await.rst","line":21,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 55: The :meth:`View.dispatch_request` method is the equivalent of the view","file":"docs/views.rst","line":55,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/views.rst\nLine 105: ``dispatch_request`` method, as they would be for a regular view","file":"docs/views.rst","line":105,"lexical":0.6000000000000001,"target":false},{"text":"File: src/flask/views.py\nLine 94: :meth:`dispatch_request` method. If the view class sets","file":"src/flask/views.py","line":94,"lexical":0.6000000000000001,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 105: def dispatch_request(self: RenderTemplateView) -> str:","file":"tests/type_check/typing_route.py","line":105,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"The configuration object is missing a method to filter and retrieve a subset of settings based on a common prefix, with options to control key casing and whether the prefix is stripped from the resulting dictionary keys.","query":"config get namespace","file":"tests/test_config.py","symbol":"test_get_namespace","line":217,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1114: - Added ``Config.get_namespace``.","file":"CHANGES.rst","line":1114,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/config.py\nLine 332: image_store_config = app.config.get_namespace('IMAGE_STORE_')","file":"src/flask/config.py","line":332,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 223: foo_options = app.config.get_namespace(\"FOO_\")","file":"tests/test_config.py","line":223,"lexical":0.65,"target":true},{"text":"File: tests/test_config.py\nLine 227: bar_options = app.config.get_namespace(\"BAR_\", lowercase=False)","file":"tests/test_config.py","line":227,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 231: foo_options = app.config.get_namespace(\"FOO_\", trim_namespace=False)","file":"tests/test_config.py","line":231,"lexical":0.65,"target":false},{"text":"File: tests/test_config.py\nLine 235: bar_options = app.config.get_namespace(","file":"tests/test_config.py","line":235,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"帮我找出这个同时继承自 GetView 和 DeleteView 的类,看看它具体做了什么。","query":"GetDeleteView","file":"tests/test_views.py","symbol":"GetDeleteView","line":227,"lang":"zh","candidates":[{"text":"File: tests/test_views.py\nLine 227: class GetDeleteView(GetView, DeleteView):","file":"tests/test_views.py","line":227,"lexical":0.35,"target":true},{"text":"File: tests/test_views.py\nLine 230: app.add_url_rule(\"/\", view_func=GetDeleteView.as_view(\"index\"))","file":"tests/test_views.py","line":230,"lexical":0.35,"target":false},{"text":"File: tests/test_views.py\nLine 234: assert sorted(GetDeleteView.methods) == [\"DELETE\", \"GET\"]","file":"tests/test_views.py","line":234,"lexical":0.35,"target":false}]} {"site":"project_search","repo":"flask","task":"Fehler beim Registrieren neuer Routen: Es wird ein ValueError geworfen, wenn der Name der Funktion oder der Endpunkt einen Punkt enthält, was die Nutzung von importierten Funktionen oder Namespaces verhindert.","query":"add url rule","file":"src/flask/sansio/blueprints.py","symbol":"add_url_rule","line":413,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 875: - ``Flask.add_url_rule`` accepts the ``provide_automatic_options``","file":"CHANGES.rst","line":875,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 909: detected by ``Flask.add_url_rule``. :pr:`2316`","file":"CHANGES.rst","line":909,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1468: ``add_url_rule`` function and can now also accept regular werkzeug","file":"CHANGES.rst","line":1468,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1469: rules added to the url map.","file":"CHANGES.rst","line":1469,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1527: application explicitly adds 'OPTIONS' as method to the URL rule. In","file":"CHANGES.rst","line":1527,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1537: - The endpoint for the ``Module.add_url_rule`` method is now optional","file":"CHANGES.rst","line":1537,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1649: - ``Flask.add_url_rule`` can now also register a view function.","file":"CHANGES.rst","line":1649,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 535: 2. You can use the :meth:`flask.Flask.add_url_rule` function.","file":"docs/api.rst","line":535,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 610: :meth:`~flask.Flask.add_url_rule` accept. The only difference is that","file":"docs/api.rst","line":610,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 646: some defaults to :meth:`~flask.Flask.add_url_rule` or general behavior:","file":"docs/api.rst","line":646,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 653: - `methods`: If methods are not provided when the URL rule is added,","file":"docs/api.rst","line":653,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 678: app.add_url_rule('/', index)","file":"docs/api.rst","line":678,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/favicon.rst\nLine 27: app.add_url_rule(","file":"docs/patterns/favicon.rst","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 123: app.add_url_rule(","file":"docs/patterns/fileuploads.rst","line":123,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 16: :meth:`~flask.Flask.add_url_rule` function. Instead of using decorators,","file":"docs/patterns/lazyloading.rst","line":16,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 50: app.add_url_rule('/', view_func=views.index)","file":"docs/patterns/lazyloading.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 51: app.add_url_rule('/user/', view_func=views.user)","file":"docs/patterns/lazyloading.rst","line":51,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 85: app.add_url_rule('/',","file":"docs/patterns/lazyloading.rst","line":85,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 87: app.add_url_rule('/user/',","file":"docs/patterns/lazyloading.rst","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 92: :meth:`~flask.Flask.add_url_rule` by prefixing a string with the project","file":"docs/patterns/lazyloading.rst","line":92,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/lazyloading.rst\nLine 98: app.add_url_rule(url_rule, view_func=view, **options)","file":"docs/patterns/lazyloading.rst","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 167: app.url_map.add(Rule('/', endpoint='index'))","file":"docs/patterns/viewdecorators.rst","line":167,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 46: app.add_url_rule('/', endpoint='index')","file":"docs/tutorial/blog.rst","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 58: ``index`` endpoint. :meth:`app.add_url_rule() `","file":"docs/tutorial/blog.rst","line":58,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 53: app.add_url_rule(\"/users/\", view_func=UserList.as_view(\"user_list\"))","file":"docs/views.rst","line":53,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 58: :meth:`~flask.Flask.add_url_rule` method. The first argument to","file":"docs/views.rst","line":58,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 91: app.add_url_rule(","file":"docs/views.rst","line":91,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 95: app.add_url_rule(","file":"docs/views.rst","line":95,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 119: app.add_url_rule(","file":"docs/views.rst","line":119,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 172: app.add_url_rule('/users/', view_func=UserList.as_view())","file":"docs/views.rst","line":172,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 182: app.add_url_rule('/users/', view_func=view)","file":"docs/views.rst","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 202: ``add_url_rule`` or ``route``.","file":"docs/views.rst","line":202,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"查找返回禁止访问错误的测试逻辑","query":"flask abort 403","file":"tests/test_blueprints.py","symbol":"bp_forbidden","line":93,"lang":"zh","candidates":[{"text":"File: tests/test_basic.py\nLine 914: flask.abort(403)","file":"tests/test_basic.py","line":914,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1010: flask.abort(403)","file":"tests/test_basic.py","line":1010,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 18: flask.abort(403)","file":"tests/test_blueprints.py","line":18,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 26: flask.abort(403)","file":"tests/test_blueprints.py","line":26,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 30: flask.abort(403)","file":"tests/test_blueprints.py","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 88: flask.abort(403)","file":"tests/test_blueprints.py","line":88,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 94: flask.abort(403)","file":"tests/test_blueprints.py","line":94,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 877: flask.abort(403)","file":"tests/test_blueprints.py","line":877,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 885: flask.abort(403)","file":"tests/test_blueprints.py","line":885,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 897: flask.abort(403)","file":"tests/test_blueprints.py","line":897,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1096: flask.abort(403)","file":"tests/test_blueprints.py","line":1096,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"我想确认一下数据库初始化的模拟逻辑,请帮我找到那个专门用来记录调用状态的函数。我目前需要在测试中验证初始化是否被正确触发。","query":"fake db init","file":"examples/tutorial/tests/test_db.py","symbol":"fake_init_db","line":23,"lang":"zh","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 203: def fake_init_db():","file":"docs/tutorial/tests.rst","line":203,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 206: monkeypatch.setattr('flaskr.db.init_db', fake_init_db)","file":"docs/tutorial/tests.rst","line":206,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_db.py\nLine 23: def fake_init_db():","file":"examples/tutorial/tests/test_db.py","line":23,"lexical":0.65,"target":true},{"text":"File: examples/tutorial/tests/test_db.py\nLine 26: monkeypatch.setattr(\"flaskr.db.init_db\", fake_init_db)","file":"examples/tutorial/tests/test_db.py","line":26,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm trying to figure out how the command-line interface handles application instantiation. Can you show me the constructor that manages the import path and the factory function for the web instance?","query":"flask app factory","file":"src/flask/cli.py","symbol":"__init__","line":305,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 605: - When specifying a factory function with ``FLASK_APP``, keyword","file":"CHANGES.rst","line":605,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 901: - ``FLASK_APP`` can be set to an app factory, with arguments if","file":"CHANGES.rst","line":901,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 101: When using the Flask application factory pattern, call the ``celery_init_app`` function","file":"docs/patterns/celery.rst","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 103: can be used to get the Celery app from the Flask app returned by the factory.","file":"docs/patterns/celery.rst","line":103,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 28: contain the application factory, and it tells Python that the ``flaskr``","file":"docs/tutorial/factory.rst","line":28,"lexical":0.65,"target":false},{"text":"File: src/flask/cli.py\nLine 88: \"Failed to find Flask application or factory in module\"","file":"src/flask/cli.py","line":88,"lexical":0.55,"target":true},{"text":"File: src/flask/cli.py\nLine 457: \"The Flask application or factory function to load, in the form 'module:name'.\"","file":"src/flask/cli.py","line":457,"lexical":0.55,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm seeing issues where the request context isn't persisting correctly during simulated requests. Where is the implementation for the test utility that allows for deferred cleanup of the request context?","query":"test client context","file":"src/flask/testing.py","symbol":"FlaskClient","line":109,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 769: - When using the test client as a context manager (``with client:``),","file":"CHANGES.rst","line":769,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1603: - Test client has not the ability to preserve the request context for","file":"CHANGES.rst","line":1603,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 172: def test_context_refcounts(app, client):","file":"tests/test_appctx.py","line":172,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 670: def test_context_processing(app, client):","file":"tests/test_blueprints.py","line":670,"lexical":0.65,"target":false},{"text":"File: tests/test_converters.py\nLine 29: def test_context_available(app, client):","file":"tests/test_converters.py","line":29,"lexical":0.65,"target":false},{"text":"File: tests/test_helpers.py\nLine 229: def test_streaming_with_context(self, app, client):","file":"tests/test_helpers.py","line":229,"lexical":0.65,"target":false},{"text":"File: tests/test_helpers.py\nLine 242: def test_streaming_with_context_as_decorator(self, app, client):","file":"tests/test_helpers.py","line":242,"lexical":0.65,"target":false},{"text":"File: tests/test_helpers.py\nLine 256: def test_streaming_with_context_and_custom_close(self, app, client):","file":"tests/test_helpers.py","line":256,"lexical":0.65,"target":false},{"text":"File: tests/test_signals.py\nLine 115: def test_appcontext_signals(app, client):","file":"tests/test_signals.py","line":115,"lexical":0.65,"target":false},{"text":"File: tests/test_signals.py\nLine 163: def test_appcontext_tearing_down_signal(app, client):","file":"tests/test_signals.py","line":163,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 11: def test_context_processing(app, client):","file":"tests/test_templating.py","line":11,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 53: def test_standard_context(app, client):","file":"tests/test_templating.py","line":53,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 198: def test_session_transactions_keep_context(app, client, req_ctx):","file":"tests/test_testing.py","line":198,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 214: def test_test_client_context_binding(app, client):","file":"tests/test_testing.py","line":214,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 284: def test_client_json_no_app_context(app, client):","file":"tests/test_testing.py","line":284,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Ich arbeite gerade an den Testfällen für die Routen-Definitionen. Kannst du mir zeigen, wie die Testfunktion implementiert ist, die prüft, ob die Startseite korrekt auf die Informationsseite weiterleitet?","query":"url_for about","file":"tests/test_blueprints.py","symbol":"index","line":162,"lang":"de","candidates":[{"text":"File: tests/test_basic.py\nLine 1659: return flask.url_for(\"about\")","file":"tests/test_basic.py","line":1659,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1667: return flask.url_for(\"about\", lang_code=\"en\")","file":"tests/test_basic.py","line":1667,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 163: return flask.url_for(\".about\")","file":"tests/test_blueprints.py","line":163,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_blueprints.py\nLine 850: return flask.url_for(\"about\")","file":"tests/test_blueprints.py","line":850,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"この値を有効なJSON型に変換し、タグ構造をその周りに追加するタグメソッドは?","query":"tag value JSON","file":"src/flask/json/tag.py","symbol":"tag","line":87,"lang":"ja","candidates":[{"text":"File: src/flask/json/tag.py\nLine 88: \"\"\"Convert the value to a valid JSON type and add the tag structure","file":"src/flask/json/tag.py","line":88,"lexical":0.65,"target":true},{"text":"File: src/flask/json/tag.py\nLine 322: \"\"\"Tag the value and dump it to a compact JSON string.\"\"\"","file":"src/flask/json/tag.py","line":322,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"I want to set up a test environment that simulates an incoming HTTP request for my Flask application. Please provide a fixture that creates this request context and yields it for use in tests.","query":"test request context","file":"tests/conftest.py","symbol":"req_ctx","line":44,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 915: - ``Flask.test_request_context`` accepts ``subdomain`` and","file":"CHANGES.rst","line":915,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1603: - Test client has not the ability to preserve the request context for","file":"CHANGES.rst","line":1603,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/appcontext.rst\nLine 99: :meth:`.Flask.test_request_context` in a ``with`` block.","file":"docs/appcontext.rst","line":99,"lexical":0.65,"target":false},{"text":"File: docs/appcontext.rst\nLine 107: with app.test_request_context(","file":"docs/appcontext.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/quickstart.rst\nLine 258: For example, here we use the :meth:`~flask.Flask.test_request_context` method","file":"docs/quickstart.rst","line":258,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 259: to try out :func:`~flask.url_for`. :meth:`~flask.Flask.test_request_context`","file":"docs/quickstart.rst","line":259,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 279: with app.test_request_context():","file":"docs/quickstart.rst","line":279,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 22: using the :attr:`~flask.Flask.test_request_context` method which creates","file":"docs/shell.rst","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 25: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/shell.rst\nLine 50: >>> ctx = app.test_request_context()","file":"docs/shell.rst","line":50,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 294: Use ``with app.test_request_context()`` to push a request context. It","file":"docs/testing.rst","line":294,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 300: with app.test_request_context(","file":"docs/testing.rst","line":300,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 308: Creating a test request context doesn't run any of the Flask dispatching","file":"docs/testing.rst","line":308,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 316: with app.test_request_context(\"/user/2/edit\", headers={\"X-Auth-Token\": \"1\"}):","file":"docs/testing.rst","line":316,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1511: environ is not trivial. Use :meth:`test_request_context` to correctly","file":"src/flask/app.py","line":1511,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1520: def test_request_context(self, *args: t.Any, **kwargs: t.Any) -> AppContext:","file":"src/flask/app.py","line":1520,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1531: with app.test_request_context(...):","file":"src/flask/app.py","line":1531,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 210: \"\"\"Test if an app context is active and if it has request information.","file":"src/flask/ctx.py","line":210,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 236: \"\"\"Test if an app context is active. Unlike :func:`has_request_context`","file":"src/flask/ctx.py","line":236,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 268: app context if needed during setup, and :meth:`.Flask.test_request_context`","file":"src/flask/ctx.py","line":268,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 269: to create a request context if needed during tests.","file":"src/flask/ctx.py","line":269,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 523: with app.test_request_context():","file":"src/flask/sansio/scaffold.py","line":523,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 152: :meth:`~flask.Flask.test_request_context` which are directly","file":"src/flask/testing.py","line":152,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 161: ctx = app.test_request_context(*args, **kwargs)","file":"src/flask/testing.py","line":161,"lexical":0.65,"target":false},{"text":"File: tests/conftest.py\nLine 45: with app.test_request_context() as ctx:","file":"tests/conftest.py","line":45,"lexical":0.65,"target":true},{"text":"File: tests/test_appctx.py\nLine 34: def test_request_context_means_app_context(app):","file":"tests/test_appctx.py","line":34,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 35: with app.test_request_context():","file":"tests/test_appctx.py","line":35,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 390: with app.test_request_context():","file":"tests/test_basic.py","line":390,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1375: with app.test_request_context():","file":"tests/test_basic.py","line":1375,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1380: with app.test_request_context():","file":"tests/test_basic.py","line":1380,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1395: with app.test_request_context():","file":"tests/test_basic.py","line":1395,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 1406: with app.test_request_context():","file":"tests/test_basic.py","line":1406,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"I'm debugging a session handling issue and need to retrieve the specific value stored in the Flask session. Please show me the helper function that extracts this 'value' key.","query":"get dynamic cookie","file":"tests/test_reqctx.py","symbol":"get_dynamic_cookie","line":233,"lang":"en","candidates":[{"text":"File: tests/test_reqctx.py\nLine 232: @app.route(\"/get_dynamic_cookie\")","file":"tests/test_reqctx.py","line":232,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_reqctx.py\nLine 233: def get_dynamic_cookie():","file":"tests/test_reqctx.py","line":233,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 249: assert test_client.get(\"/get_dynamic_cookie\").data == b\"616\"","file":"tests/test_reqctx.py","line":249,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"テンプレートの継承について教えて","query":"template inheritance","file":"docs/patterns/templateinheritance.rst","symbol":"Template Inheritance","line":1,"lang":"ja","candidates":[{"text":"File: docs/design.rst\nLine 111: extensive filter system, a certain way to do template inheritance,","file":"docs/design.rst","line":111,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/design.rst\nLine 115: like Genshi is based on XML stream evaluation, template inheritance by","file":"docs/design.rst","line":115,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/index.rst\nLine 28: templateinheritance","file":"docs/patterns/index.rst","line":28,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/templateinheritance.rst\nLine 1: Template Inheritance","file":"docs/patterns/templateinheritance.rst","line":1,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/patterns/templateinheritance.rst\nLine 4: The most powerful part of Jinja is template inheritance. Template inheritance","file":"docs/patterns/templateinheritance.rst","line":4,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/quickstart.rst\nLine 415: Templates are especially useful if inheritance is used. If you want to","file":"docs/quickstart.rst","line":415,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 416: know how that works, see :doc:`patterns/templateinheritance`. Basically","file":"docs/quickstart.rst","line":416,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 417: template inheritance makes it possible to keep certain elements on each","file":"docs/quickstart.rst","line":417,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"créer un objet réponse flask avec type mime html par défaut","query":"flask response class","file":"src/flask/wrappers.py","symbol":"Response","line":222,"lang":"fr","candidates":[{"text":"File: docs/api.rst\nLine 48: .. autoclass:: flask.Response","file":"docs/api.rst","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 290: and returns the :class:`Response` object returned by Flask. Similarly,","file":"docs/tutorial/tests.rst","line":290,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 246: #: :class:`~flask.Response` for more information.","file":"src/flask/app.py","line":246,"lexical":0.55,"target":false},{"text":"File: src/flask/json/__init__.py\nLine 140: :class:`~flask.Response` object with the ``application/json``","file":"src/flask/json/__init__.py","line":140,"lexical":0.55,"target":false},{"text":"File: src/flask/json/provider.py\nLine 91: :class:`~flask.Response` object with the ``application/json``","file":"src/flask/json/provider.py","line":91,"lexical":0.55,"target":false},{"text":"File: src/flask/json/provider.py\nLine 191: :class:`~flask.Response` object with it. The response mimetype","file":"src/flask/json/provider.py","line":191,"lexical":0.55,"target":false},{"text":"File: src/flask/typing.py\nLine 44: # Allow any subclass of werkzeug.Response, such as the one from Flask,","file":"src/flask/typing.py","line":44,"lexical":0.55,"target":false},{"text":"File: src/flask/wrappers.py\nLine 229: set :attr:`~flask.Flask.response_class` to your subclass.","file":"src/flask/wrappers.py","line":229,"lexical":0.55,"target":true}]} {"site":"project_search","repo":"flask","task":"¿Cómo obtener la URL completa de la solicitud actual en Flask?","query":"flask request url","file":"tests/test_reqctx.py","symbol":"meh","line":112,"lang":"es","candidates":[{"text":"File: docs/patterns/fileuploads.rst\nLine 22: from flask import Flask, flash, request, redirect, url_for","file":"docs/patterns/fileuploads.rst","line":22,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 28: from flask import g, request, redirect, url_for","file":"docs/patterns/viewdecorators.rst","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 259: to try out :func:`~flask.url_for`. :meth:`~flask.Flask.test_request_context`","file":"docs/quickstart.rst","line":259,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 7: application. Flask uses patterns to match the incoming request URL to","file":"docs/tutorial/views.rst","line":7,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 113: return flask.request.url","file":"tests/test_reqctx.py","line":113,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_reqctx.py\nLine 206: if flask.request.url.endswith(\"dynamic_cookie\"):","file":"tests/test_reqctx.py","line":206,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 21: return flask.request.url","file":"tests/test_testing.py","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 33: return flask.request.url","file":"tests/test_testing.py","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 92: return flask.request.url","file":"tests/test_testing.py","line":92,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 126: return flask.request.url","file":"tests/test_testing.py","line":126,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Die Testfunktion löst fälschlicherweise eine Division durch Null aus, anstatt den erwarteten Testfall zu bestehen.","query":"raise ZeroDivisionError","file":"tests/test_testing.py","symbol":"other","line":223,"lang":"de","candidates":[{"text":"File: tests/test_appctx.py\nLine 203: raise ZeroDivisionError","file":"tests/test_appctx.py","line":203,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 843: raise ZeroDivisionError","file":"tests/test_basic.py","line":843,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 910: raise ZeroDivisionError","file":"tests/test_basic.py","line":910,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 936: raise ZeroDivisionError","file":"tests/test_basic.py","line":936,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1106: raise ZeroDivisionError","file":"tests/test_basic.py","line":1106,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1111: raise ZeroDivisionError","file":"tests/test_basic.py","line":1111,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1616: raise ZeroDivisionError","file":"tests/test_basic.py","line":1616,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1621: with pytest.raises(ZeroDivisionError):","file":"tests/test_basic.py","line":1621,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_signals.py\nLine 101: raise ZeroDivisionError","file":"tests/test_signals.py","line":101,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_signals.py\nLine 172: raise ZeroDivisionError","file":"tests/test_signals.py","line":172,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_testing.py\nLine 224: raise ZeroDivisionError","file":"tests/test_testing.py","line":224,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_views.py\nLine 44: raise ZeroDivisionError","file":"tests/test_views.py","line":44,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_views.py\nLine 47: raise ZeroDivisionError","file":"tests/test_views.py","line":47,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Comment créer l'application Flask ?","query":"create Flask app","file":"tests/test_apps/cliapp/factory.py","symbol":"create_app","line":4,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 902: needed, for example ``FLASK_APP=myproject.app:create_app('dev')``.","file":"CHANGES.rst","line":902,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 492: @click.group(cls=FlaskGroup, create_app=create_app)","file":"docs/cli.rst","line":492,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 102: $ flask --app 'hello:create_app(local_auth=True)' run","file":"docs/patterns/appfactories.rst","line":102,"lexical":0.65,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 39: and registers tasks. While creating a Flask app, use the following code to create and","file":"docs/patterns/celery.rst","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 107: def create_app() -> Flask:","file":"docs/patterns/celery.rst","line":107,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 128: flask_app = create_app()","file":"docs/patterns/celery.rst","line":128,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 100: $ waitress-serve --call 'flaskr:create_app'","file":"docs/tutorial/deploy.rst","line":100,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 10: The most straightforward way to create a Flask application is to create","file":"docs/tutorial/factory.rst","line":10,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 71: #. ``app = Flask(__name__, instance_relative_config=True)`` creates the","file":"docs/tutorial/factory.rst","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 115: #. :meth:`@app.route() ` creates a simple route so you can","file":"docs/tutorial/factory.rst","line":115,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 74: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":74,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 150: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":150,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/make_celery.py\nLine 3: flask_app = create_app()","file":"examples/celery/make_celery.py","line":3,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/src/task_app/__init__.py\nLine 7: def create_app() -> Flask:","file":"examples/celery/src/task_app/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 7: \"\"\"Create and configure an instance of the Flask application.\"\"\"","file":"examples/tutorial/flaskr/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 6: from flaskr import create_app","file":"examples/tutorial/tests/conftest.py","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_factory.py\nLine 1: from flaskr import create_app","file":"examples/tutorial/tests/test_factory.py","line":1,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 308: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":308,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 566: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":566,"lexical":0.55,"target":false},{"text":"File: src/flask/ctx.py\nLine 267: Do not use this class directly. Use :meth:`.Flask.app_context` to create an","file":"src/flask/ctx.py","line":267,"lexical":0.55,"target":false},{"text":"File: tests/test_cli.py\nLine 265: return Flask(\"createapp\")","file":"tests/test_cli.py","line":265,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 301: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":301,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 312: obj = ScriptInfo(create_app=lambda: Flask(\"testapp\"))","file":"tests/test_cli.py","line":312,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 336: obj = ScriptInfo(create_app=lambda: Flask(\"testappgroup\"))","file":"tests/test_cli.py","line":336,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 351: @click.group(cls=FlaskGroup, create_app=create_app)","file":"tests/test_cli.py","line":351,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 371: @click.group(cls=FlaskGroup, create_app=create_app, set_debug_flag=set_debug_flag)","file":"tests/test_cli.py","line":371,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 386: flask_group = FlaskGroup(name=\"flask\", create_app=lambda: app)","file":"tests/test_cli.py","line":386,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 431: cli = FlaskGroup(create_app=create_app)","file":"tests/test_cli.py","line":431,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 459: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":459,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 497: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":497,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"retorna uma string com o valor quarenta e dois","query":"return \"42\"","file":"tests/test_helpers.py","symbol":"index","line":158,"lang":"pt","candidates":[{"text":"File: tests/test_basic.py\nLine 882: return \"42\"","file":"tests/test_basic.py","line":882,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 980: return \"42\"","file":"tests/test_basic.py","line":980,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 98: return \"42\"","file":"tests/test_helpers.py","line":98,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_helpers.py\nLine 105: return \"42\"","file":"tests/test_helpers.py","line":105,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 126: return \"42\"","file":"tests/test_helpers.py","line":126,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_helpers.py\nLine 159: return \"42\"","file":"tests/test_helpers.py","line":159,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_request.py\nLine 19: return \"42\"","file":"tests/test_request.py","line":19,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"상속받은 하위 클래스에서 반드시 구현해야 하며, URL 규칙에서 추출된 변수들을 키워드 인자로 전달받아 최종 응답을 반환하는 핵심 로직이 정의되지 않았을 때 발생하는 오류를 확인해 주세요.","query":"dispatch request","file":"src/flask/views.py","symbol":"dispatch_request","line":78,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 10: when dispatching a request. This greatly simplifies the internal code for tracking","file":"CHANGES.rst","line":10,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 12: - Many ``Flask`` methods involved in request dispatch now take the current","file":"CHANGES.rst","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1414: - HEAD requests to a method view now automatically dispatch to the","file":"CHANGES.rst","line":1414,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1650: - Refactored internal request dispatching.","file":"CHANGES.rst","line":1650,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/appcontext.rst\nLine 147: Flask dispatches a request in multiple stages which can affect the request,","file":"docs/appcontext.rst","line":147,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/appcontext.rst\nLine 154: - The request is dispatched.","file":"docs/appcontext.rst","line":154,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/appcontext.rst\nLine 165: that any other parts of the request dispatch have run. Be sure to write these","file":"docs/appcontext.rst","line":165,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/async-await.rst\nLine 21: coroutines. This applies to the :meth:`~flask.views.View.dispatch_request`","file":"docs/async-await.rst","line":21,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 53: blueprints when dispatching requests and generating URLs from one endpoint","file":"docs/blueprints.rst","line":53,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 305: request (inside a request, the dispatcher is responsible for setting","file":"docs/config.rst","line":305,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 71: instance you configure your webserver to dispatch all requests for all","file":"docs/patterns/appdispatch.rst","line":71,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/testing.rst\nLine 308: Creating a test request context doesn't run any of the Flask dispatching","file":"docs/testing.rst","line":308,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 49: def dispatch_request(self):","file":"docs/views.rst","line":49,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 55: The :meth:`View.dispatch_request` method is the equivalent of the view","file":"docs/views.rst","line":55,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 70: them on ``self``. Then ``dispatch_request`` can reference these instead","file":"docs/views.rst","line":70,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 80: def dispatch_request(self):","file":"docs/views.rst","line":80,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 105: ``dispatch_request`` method, as they would be for a regular view","file":"docs/views.rst","line":105,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 115: def dispatch_request(self, id)","file":"docs/views.rst","line":115,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 152: def dispatch_request(self):","file":"docs/views.rst","line":152,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/views.rst\nLine 209: def dispatch_request(self):","file":"docs/views.rst","line":209,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 266: cls.dispatch_request,","file":"src/flask/app.py","line":266,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 267: cls.full_dispatch_request,","file":"src/flask/app.py","line":267,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 969: def dispatch_request(self, ctx: AppContext) -> ft.ResponseReturnValue:","file":"src/flask/app.py","line":969,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 970: \"\"\"Does the request dispatching. Matches the URL and returns the","file":"src/flask/app.py","line":970,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 977: moved to the new :meth:`full_dispatch_request`.","file":"src/flask/app.py","line":977,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 995: def full_dispatch_request(self, ctx: AppContext) -> Response:","file":"src/flask/app.py","line":995,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 996: \"\"\"Dispatches the request and on top of that performs request","file":"src/flask/app.py","line":996,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1019: rv = self.dispatch_request(ctx)","file":"src/flask/app.py","line":1019,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1033: request dispatching as well as error handlers.","file":"src/flask/app.py","line":1033,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1370: \"\"\"Called before the request is dispatched. Calls","file":"src/flask/app.py","line":1370,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1426: \"\"\"Called after the request is dispatched and the response is finalized,","file":"src/flask/app.py","line":1426,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1434: :param exc: An unhandled exception raised while dispatching the request.","file":"src/flask/app.py","line":1434,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"busca la función para crear un ejecutor de comandos por terminal para pruebas","query":"cli test runner","file":"src/flask/app.py","symbol":"test_cli_runner","line":816,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 983: - Added ``Flask.test_cli_runner`` to create a Click runner that can","file":"CHANGES.rst","line":983,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 133: Test CLI Runner","file":"docs/api.rst","line":133,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 41: test client, and CLI runner are shown below, they can be placed in","file":"docs/testing.rst","line":41,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 80: return app.test_cli_runner()","file":"docs/testing.rst","line":80,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 248: Flask provides :meth:`~flask.Flask.test_cli_runner` to create a","file":"docs/testing.rst","line":248,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 249: :class:`~flask.testing.FlaskCliRunner`, which runs CLI commands in","file":"docs/testing.rst","line":249,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 251: object. Flask's runner extends :doc:`Click's runner `,","file":"docs/testing.rst","line":251,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 254: Use the runner's :meth:`~flask.testing.FlaskCliRunner.invoke` method to","file":"docs/testing.rst","line":254,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 107: return app.test_cli_runner()","file":"docs/tutorial/tests.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 43: \"\"\"A test runner for the app's Click commands.\"\"\"","file":"examples/tutorial/tests/conftest.py","line":43,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 44: return app.test_cli_runner()","file":"examples/tutorial/tests/conftest.py","line":44,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 62: from .testing import FlaskCliRunner","file":"src/flask/app.py","line":62,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 816: def test_cli_runner(self, **kwargs: t.Any) -> FlaskCliRunner:","file":"src/flask/app.py","line":816,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 817: \"\"\"Create a CLI runner for testing CLI commands.","file":"src/flask/app.py","line":817,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 820: Returns an instance of :attr:`test_cli_runner_class`, by default","file":"src/flask/app.py","line":820,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 821: :class:`~flask.testing.FlaskCliRunner`. The Flask app object is","file":"src/flask/app.py","line":821,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 826: cls = self.test_cli_runner_class","file":"src/flask/app.py","line":826,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 829: from .testing import FlaskCliRunner as cls","file":"src/flask/app.py","line":829,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 40: from ..testing import FlaskCliRunner","file":"src/flask/sansio/app.py","line":40,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 268: #: The :class:`~click.testing.CliRunner` subclass, by default","file":"src/flask/sansio/app.py","line":268,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 269: #: :class:`~flask.testing.FlaskCliRunner` that is used by","file":"src/flask/sansio/app.py","line":269,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 270: #: :meth:`test_cli_runner`. Its ``__init__`` method should take a","file":"src/flask/sansio/app.py","line":270,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 274: test_cli_runner_class: type[FlaskCliRunner] | None = None","file":"src/flask/sansio/app.py","line":274,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 12: from click.testing import CliRunner","file":"src/flask/testing.py","line":12,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 266: \"\"\"A :class:`~click.testing.CliRunner` for testing a Flask app's","file":"src/flask/testing.py","line":266,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 268: :meth:`~flask.Flask.test_cli_runner`. See :ref:`testing-cli`.","file":"src/flask/testing.py","line":268,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 279: :meth:`CliRunner.invoke ` for","file":"src/flask/testing.py","line":279,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 14: from click.testing import CliRunner","file":"tests/test_cli.py","line":14,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 288: def test_app_cli_has_app_context(app, runner):","file":"tests/test_cli.py","line":288,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 338: result = runner.invoke(cli, [\"test\"], obj=obj)","file":"tests/test_cli.py","line":338,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 342: result = runner.invoke(cli, [\"subgroup\", \"test2\"], obj=obj)","file":"tests/test_cli.py","line":342,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Je suis en train de vérifier la gestion des erreurs dans les tests. Peux-tu me montrer la logique qui vérifie si un message de retour indique une erreur interne directe ou si elle contient une exception d'origine encapsulée ?","query":"handle 500 error","file":"tests/test_user_error_handler.py","symbol":"handle_500","line":30,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 705: - Error handlers for ``InternalServerError`` or ``500`` will always be","file":"CHANGES.rst","line":705,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 714: exceptions even if there is no ``500`` error handler.","file":"CHANGES.rst","line":714,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/debugging.rst\nLine 70: turns unhandled errors into generic 500 error pages. However, the built-in debugger and","file":"docs/debugging.rst","line":70,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 240: When there is no error handler registered for an exception, a 500","file":"docs/errorhandling.rst","line":240,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 252: An error handler for \"500 Internal Server Error\" will be passed uncaught","file":"docs/errorhandling.rst","line":252,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 253: exceptions in addition to explicit 500 errors. In debug mode, a handler","file":"docs/errorhandling.rst","line":253,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 355: @app.errorhandler(500)","file":"docs/errorhandling.rst","line":355,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 371: app.register_error_handler(500, internal_server_error)","file":"docs/errorhandling.rst","line":371,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 383: @blog.errorhandler(500)","file":"docs/errorhandling.rst","line":383,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 388: blog.register_error_handler(500, internal_server_error)","file":"docs/errorhandling.rst","line":388,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 896: @app.errorhandler(500)","file":"tests/test_basic.py","line":896,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 930: @app.errorhandler(500)","file":"tests/test_basic.py","line":930,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1119: @app.errorhandler(500)","file":"tests/test_basic.py","line":1119,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 29: @app.errorhandler(500)","file":"tests/test_user_error_handler.py","line":29,"lexical":0.65,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 139: @bp.errorhandler(500)","file":"tests/test_user_error_handler.py","line":139,"lexical":0.65,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 147: @app.errorhandler(500)","file":"tests/test_user_error_handler.py","line":147,"lexical":0.65,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 252: @pytest.mark.parametrize(\"to_handle\", (InternalServerError, 500))","file":"tests/test_user_error_handler.py","line":252,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"处理请求生命周期包括预处理发送信号执行路由和异常处理","query":"full dispatch request","file":"src/flask/app.py","symbol":"full_dispatch_request","line":995,"lang":"zh","candidates":[{"text":"File: src/flask/app.py\nLine 267: cls.full_dispatch_request,","file":"src/flask/app.py","line":267,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 977: moved to the new :meth:`full_dispatch_request`.","file":"src/flask/app.py","line":977,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 995: def full_dispatch_request(self, ctx: AppContext) -> Response:","file":"src/flask/app.py","line":995,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1526: without dispatching a full request. Use this as a ``with`` block to push","file":"src/flask/app.py","line":1526,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 1600: response = self.full_dispatch_request(ctx)","file":"src/flask/app.py","line":1600,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"認証済みユーザーのみにアクセスを制限するデコレータはどこにありますか?","query":"login required decorator","file":"docs/patterns/viewdecorators.rst","symbol":"Login Required Decorator","line":15,"lang":"ja","candidates":[{"text":"File: docs/patterns/viewdecorators.rst\nLine 15: Login Required Decorator","file":"docs/patterns/viewdecorators.rst","line":15,"lexical":0.65,"target":true},{"text":"File: docs/tutorial/blog.rst\nLine 138: The ``login_required`` decorator you wrote earlier is used on the blog","file":"docs/tutorial/blog.rst","line":138,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/views.rst\nLine 170: decorators = [cache(minutes=2), login_required]","file":"docs/views.rst","line":170,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Cómo se inicializa la aplicación y se configura la base de datos?","query":"Flask app factory","file":"examples/tutorial/flaskr/__init__.py","symbol":"create_app","line":6,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 605: - When specifying a factory function with ``FLASK_APP``, keyword","file":"CHANGES.rst","line":605,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 901: - ``FLASK_APP`` can be set to an app factory, with arguments if","file":"CHANGES.rst","line":901,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 101: When using the Flask application factory pattern, call the ``celery_init_app`` function","file":"docs/patterns/celery.rst","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 103: can be used to get the Celery app from the Flask app returned by the factory.","file":"docs/patterns/celery.rst","line":103,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 28: contain the application factory, and it tells Python that the ``flaskr``","file":"docs/tutorial/factory.rst","line":28,"lexical":0.65,"target":false},{"text":"File: src/flask/cli.py\nLine 88: \"Failed to find Flask application or factory in module\"","file":"src/flask/cli.py","line":88,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 457: \"The Flask application or factory function to load, in the form 'module:name'.\"","file":"src/flask/cli.py","line":457,"lexical":0.55,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Dónde se encuentra la función que devuelve este string estático en las pruebas básicas?","query":"return \"bar\"","file":"tests/test_basic.py","symbol":"bar","line":226,"lang":"es","candidates":[{"text":"File: tests/test_basic.py\nLine 205: return \"bar\"","file":"tests/test_basic.py","line":205,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_basic.py\nLine 227: return \"bar\"","file":"tests/test_basic.py","line":227,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1188: return {\"foo\": \"bar\"}, 201","file":"tests/test_basic.py","line":1188,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1192: return [\"foo\", \"bar\"], 201","file":"tests/test_basic.py","line":1192,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1252: return \"Hello\", 234, {\"X-Foo\": \"Bar\"}, \"???\"","file":"tests/test_basic.py","line":1252,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"I am working on extending the template context for a Flask application and need to register a global function. Please show me how to add a template global that is available in all rendered templates.","query":"add template global","file":"src/flask/sansio/blueprints.py","symbol":"decorator","line":583,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1214: - Added ``template_global`` methods in addition to the already","file":"CHANGES.rst","line":1214,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 181: :meth:`~.Flask.add_template_test` method. For template global functions, use the","file":"docs/templating.rst","line":181,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 182: :meth:`~.Flask.template_global` decorator or :meth:`~.Flask.add_template_global`","file":"docs/templating.rst","line":182,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 791: The :meth:`add_template_global` method may be used to register a","file":"src/flask/sansio/app.py","line":791,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 800: self.add_template_global(name)","file":"src/flask/sansio/app.py","line":800,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 804: self.add_template_global(f, name=name)","file":"src/flask/sansio/app.py","line":804,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 810: def add_template_global(","file":"src/flask/sansio/app.py","line":810,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 568: The :meth:`add_app_template_global` method may be used to register a","file":"src/flask/sansio/blueprints.py","line":568,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 580: self.add_app_template_global(name)","file":"src/flask/sansio/blueprints.py","line":580,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 584: self.add_app_template_global(f, name=name)","file":"src/flask/sansio/blueprints.py","line":584,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 590: def add_app_template_global(","file":"src/flask/sansio/blueprints.py","line":590,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 599: blueprint. Equivalent to :meth:`.Flask.add_template_global`.","file":"src/flask/sansio/blueprints.py","line":599,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 609: state.app.add_template_global(f, name=name)","file":"src/flask/sansio/blueprints.py","line":609,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 359: def test_add_template_global(app, app_ctx):","file":"tests/test_templating.py","line":359,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Se está registrando un manejador de excepciones que debería aplicarse a nivel de aplicación global, pero parece que la configuración ocurre de forma tardía o diferida mediante un mecanismo de registro de tareas de configuración, lo que podría causar que no capture errores correctamente si no se ejecuta en el momento adecuado.","query":"app error handler","file":"src/flask/sansio/blueprints.py","symbol":"app_errorhandler","line":656,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 519: - Enhance typing of ``app.errorhandler`` decorator. :issue:`4095`","file":"CHANGES.rst","line":519,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 880: request are handled by the app's error handlers. :pr:`2254`","file":"CHANGES.rst","line":880,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1186: ``app.url_build_error_handlers`` reraises the ``BuildError``.","file":"CHANGES.rst","line":1186,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1599: - Added the ability to register application wide error handlers from","file":"CHANGES.rst","line":1599,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 302: the application instance has no way of knowing which blueprint error handler it","file":"docs/blueprints.rst","line":302,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 307: @app.errorhandler(404)","file":"docs/blueprints.rst","line":307,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/blueprints.rst\nLine 308: @app.errorhandler(405)","file":"docs/blueprints.rst","line":308,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/config.rst\nLine 83: the app's error handlers. Extensions may also change their behavior to","file":"docs/config.rst","line":83,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 107: @app.errorhandler(werkzeug.exceptions.BadRequest)","file":"docs/errorhandling.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 112: app.register_error_handler(400, handle_bad_request)","file":"docs/errorhandling.rst","line":112,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 129: app.register_error_handler(InsufficientStorage, handle_507)","file":"docs/errorhandling.rst","line":129,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 194: @app.errorhandler(HTTPException)","file":"docs/errorhandling.rst","line":194,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 222: @app.errorhandler(Exception)","file":"docs/errorhandling.rst","line":222,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 301: @app.errorhandler(404)","file":"docs/errorhandling.rst","line":301,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 317: app.register_error_handler(404, page_not_found)","file":"docs/errorhandling.rst","line":317,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 355: @app.errorhandler(500)","file":"docs/errorhandling.rst","line":355,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 371: app.register_error_handler(500, internal_server_error)","file":"docs/errorhandling.rst","line":371,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 396: exceptions. These error handlers are only invoked from an appropriate","file":"docs/errorhandling.rst","line":396,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 413: @app.errorhandler(404)","file":"docs/errorhandling.rst","line":413,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 423: @app.errorhandler(405)","file":"docs/errorhandling.rst","line":423,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 450: @app.errorhandler(404)","file":"docs/errorhandling.rst","line":450,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 489: @app.errorhandler(InvalidAPIUsage)","file":"docs/errorhandling.rst","line":489,"lexical":0.65,"target":false},{"text":"File: docs/lifecycle.rst\nLine 55: ``@app.errorhandler``, ``@app.before_request``, etc.","file":"docs/lifecycle.rst","line":55,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 621: @app.errorhandler(404)","file":"docs/quickstart.rst","line":621,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 668: @app.errorhandler(404)","file":"docs/quickstart.rst","line":668,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 678: @app.errorhandler(404)","file":"docs/quickstart.rst","line":678,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 397: app.error_handler_spec[key] = value","file":"src/flask/sansio/blueprints.py","line":397,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 656: def app_errorhandler(","file":"src/flask/sansio/blueprints.py","line":656,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 665: state.app.errorhandler(code)(f)","file":"src/flask/sansio/blueprints.py","line":665,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 614: @app.errorhandler(404)","file":"src/flask/sansio/scaffold.py","line":614,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 620: @app.errorhandler(DatabaseError)","file":"src/flask/sansio/scaffold.py","line":620,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 627: and affect every request, use :meth:`.Blueprint.app_errorhandler`.","file":"src/flask/sansio/scaffold.py","line":627,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"How can I verify that the application context lifecycle events are firing correctly during a request?","query":"appcontext signals test","file":"tests/test_signals.py","symbol":"test_appcontext_signals","line":115,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1170: - Fixed broken ``test_appcontext_signals()`` test case.","file":"CHANGES.rst","line":1170,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 115: def test_appcontext_signals(app, client):","file":"tests/test_signals.py","line":115,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"テンプレートにカスタムテストを追加する動作を確認する","query":"add template test","file":"tests/test_templating.py","symbol":"test_add_template_test_with_name","line":295,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 1212: - Added ``template_test`` methods in addition to the already existing","file":"CHANGES.rst","line":1212,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 181: :meth:`~.Flask.add_template_test` method. For template global functions, use the","file":"docs/templating.rst","line":181,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 737: The :meth:`add_template_test` method may be used to register a function","file":"src/flask/sansio/app.py","line":737,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 746: self.add_template_test(name)","file":"src/flask/sansio/app.py","line":746,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 750: self.add_template_test(f, name=name)","file":"src/flask/sansio/app.py","line":750,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 756: def add_template_test(","file":"src/flask/sansio/app.py","line":756,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 510: The :meth:`add_app_template_test` method may be used to register a","file":"src/flask/sansio/blueprints.py","line":510,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 522: self.add_app_template_test(name)","file":"src/flask/sansio/blueprints.py","line":522,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 526: self.add_app_template_test(f, name=name)","file":"src/flask/sansio/blueprints.py","line":526,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 532: def add_app_template_test(","file":"src/flask/sansio/blueprints.py","line":532,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 541: blueprint. Equivalent to :meth:`.Flask.add_template_test`.","file":"src/flask/sansio/blueprints.py","line":541,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 551: state.app.add_template_test(f, name=name)","file":"src/flask/sansio/blueprints.py","line":551,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 387: def test_add_template_filter(app):","file":"tests/test_blueprints.py","line":387,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 413: def test_add_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":413,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 459: def test_add_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":459,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 493: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":493,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 547: def test_add_template_test(app):","file":"tests/test_blueprints.py","line":547,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 553: bp.add_app_template_test(is_boolean)","file":"tests/test_blueprints.py","line":553,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 573: def test_add_template_test_with_name(app):","file":"tests/test_blueprints.py","line":573,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 579: bp.add_app_template_test(is_boolean, \"boolean\")","file":"tests/test_blueprints.py","line":579,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 619: def test_add_template_test_with_template(app, client):","file":"tests/test_blueprints.py","line":619,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 625: bp.add_app_template_test(boolean)","file":"tests/test_blueprints.py","line":625,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 653: def test_add_template_test_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":653,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 659: bp.add_app_template_test(is_boolean, \"boolean\")","file":"tests/test_blueprints.py","line":659,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 157: def test_add_template_filter(app):","file":"tests/test_templating.py","line":157,"lexical":0.65,"target":true},{"text":"File: tests/test_templating.py\nLine 177: def test_add_template_filter_with_name(app):","file":"tests/test_templating.py","line":177,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 200: def test_add_template_filter_with_template(app, client):","file":"tests/test_templating.py","line":200,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 227: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_templating.py","line":227,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 275: def test_add_template_test(app):","file":"tests/test_templating.py","line":275,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 279: app.add_template_test(boolean)","file":"tests/test_templating.py","line":279,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 295: def test_add_template_test_with_name(app):","file":"tests/test_templating.py","line":295,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 299: app.add_template_test(is_boolean, \"boolean\")","file":"tests/test_templating.py","line":299,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Cómo renderizar una plantilla con Flask usando una variable de configuración?","query":"flask render_template_string","file":"tests/test_templating.py","symbol":"index","line":26,"lang":"es","candidates":[{"text":"File: CHANGES.rst\nLine 1162: - Turn on autoescape for ``flask.templating.render_template_string``","file":"CHANGES.rst","line":1162,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/templating.rst\nLine 24: :func:`~flask.templating.render_template_string`.","file":"docs/templating.rst","line":24,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 169: assert flask.render_template_string(\"{{ g.spam }}\") == \"eggs\"","file":"tests/test_appctx.py","line":169,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 674: return flask.render_template_string(","file":"tests/test_blueprints.py","line":674,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 752: rv = flask.render_template_string(\"{{ get_answer() }}\")","file":"tests/test_blueprints.py","line":752,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 755: rv = flask.render_template_string(\"{{ get_stuff_1() }}\")","file":"tests/test_blueprints.py","line":755,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 758: rv = flask.render_template_string(\"{{ my_get_stuff_custom_name_2() }}\")","file":"tests/test_blueprints.py","line":758,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 761: rv = flask.render_template_string(\"{{ my_get_stuff_custom_name_3() }}\")","file":"tests/test_blueprints.py","line":761,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 981: return flask.render_template_string(\"{{ key }}\")","file":"tests/test_blueprints.py","line":981,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_json.py\nLine 213: rv = flask.render_template_string(","file":"tests/test_json.py","line":213,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 27: return flask.render_template_string(\"{{ config }}\", config=42)","file":"tests/test_templating.py","line":27,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_templating.py\nLine 49: rv = flask.render_template_string(\"Hello {{ config.WORLD_NAME }} {{ foo }}\")","file":"tests/test_templating.py","line":49,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 58: return flask.render_template_string(","file":"tests/test_templating.py","line":58,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 114: assert flask.render_template_string(\"{{ foo }}\", foo=\"\") == \"<test>\"","file":"tests/test_templating.py","line":114,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 368: rv = flask.render_template_string(\"{{ get_stuff() }}\")","file":"tests/test_templating.py","line":368,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 379: rv = flask.render_template_string(\"{{ get_stuff_1() }}\")","file":"tests/test_templating.py","line":379,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 390: rv = flask.render_template_string(\"{{ my_get_stuff_custom_name_2() }}\")","file":"tests/test_templating.py","line":390,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 401: rv = flask.render_template_string(\"{{ my_get_stuff_custom_name_3() }}\")","file":"tests/test_templating.py","line":401,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Estoy intentando verificar si la sesión se mantiene correctamente durante las pruebas. ¿Podrías mostrarme la función que inicializa un valor específico en la sesión de Flask para este caso?","query":"flask session testing","file":"tests/test_basic.py","symbol":"index","line":283,"lang":"es","candidates":[{"text":"File: docs/testing.rst\nLine 224: :meth:`~flask.testing.FlaskClient.session_transaction` method in a","file":"docs/testing.rst","line":224,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 284: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":284,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_basic.py\nLine 306: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":306,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 327: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":327,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 332: flask.session.pop(\"testing\", None)","file":"tests/test_basic.py","line":332,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 359: flask.session[\"testing\"] = 42","file":"tests/test_basic.py","line":359,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Qué devuelve la función que simula la ruta principal en las pruebas básicas?","query":"return \"index\"","file":"tests/test_basic.py","symbol":"index","line":207,"lang":"es","candidates":[{"text":"File: examples/tutorial/flaskr/auth.py\nLine 105: return redirect(url_for(\"index\"))","file":"examples/tutorial/flaskr/auth.py","line":105,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/flaskr/auth.py\nLine 116: return redirect(url_for(\"index\"))","file":"examples/tutorial/flaskr/auth.py","line":116,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 208: return \"index\"","file":"tests/test_basic.py","line":208,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_basic.py\nLine 231: return \"index\"","file":"tests/test_basic.py","line":231,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 854: return flask.url_for(\"index\")","file":"tests/test_blueprints.py","line":854,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1013: return \"index\"","file":"tests/test_blueprints.py","line":1013,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"find where to register callbacks for when the application context is destroyed","query":"app context teardown","file":"src/flask/sansio/app.py","symbol":"teardown_appcontext","line":827,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1175: or app context to be passed to teardown handlers.","file":"CHANGES.rst","line":1175,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/appcontext.rst\nLine 157: - Any :meth:`.Flask.teardown_appcontext` decorated functions are called.","file":"docs/appcontext.rst","line":157,"lexical":0.65,"target":false},{"text":"File: docs/extensiondev.rst\nLine 185: :meth:`~flask.Flask.teardown_appcontext` to ensure that it gets closed when the","file":"docs/extensiondev.rst","line":185,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 155: #. Any :meth:`~.Flask.teardown_appcontext` decorated functions are called.","file":"docs/lifecycle.rst","line":155,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 66: @app.teardown_appcontext","file":"docs/patterns/sqlalchemy.rst","line":66,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlalchemy.rst\nLine 139: @app.teardown_appcontext","file":"docs/patterns/sqlalchemy.rst","line":139,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 21: @app.teardown_appcontext","file":"docs/patterns/sqlite3.rst","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/sqlite3.rst\nLine 43: Please keep in mind that the teardown request and appcontext functions","file":"docs/patterns/sqlite3.rst","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 169: app.teardown_appcontext(close_db)","file":"docs/tutorial/database.rst","line":169,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 172: :meth:`app.teardown_appcontext() ` tells","file":"docs/tutorial/database.rst","line":172,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/db.py\nLine 55: app.teardown_appcontext(close_db)","file":"examples/tutorial/flaskr/db.py","line":55,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 273: cls.do_teardown_appcontext,","file":"src/flask/app.py","line":273,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1456: def do_teardown_appcontext(","file":"src/flask/app.py","line":1456,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1462: This calls all functions decorated with :meth:`teardown_appcontext`.","file":"src/flask/app.py","line":1462,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1475: for func in reversed(self.teardown_appcontext_funcs):","file":"src/flask/app.py","line":1475,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 1586: Teardown events for the request and app contexts are called","file":"src/flask/app.py","line":1586,"lexical":0.65,"target":false},{"text":"File: src/flask/ctx.py\nLine 273: request) then :meth:`.Flask.teardown_appcontext`.","file":"src/flask/ctx.py","line":273,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 496: self.app.do_teardown_appcontext(self, exc)","file":"src/flask/ctx.py","line":496,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 360: self.teardown_appcontext_funcs: list[ft.TeardownCallable] = []","file":"src/flask/sansio/app.py","line":360,"lexical":0.65,"target":true},{"text":"File: src/flask/sansio/app.py\nLine 827: def teardown_appcontext(self, f: T_teardown) -> T_teardown:","file":"src/flask/sansio/app.py","line":827,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 838: teardown functions are called just before the app context is","file":"src/flask/sansio/app.py","line":838,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 854: self.teardown_appcontext_funcs.append(f)","file":"src/flask/sansio/app.py","line":854,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 49: @app.teardown_appcontext","file":"tests/test_appctx.py","line":49,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 62: @app.teardown_appcontext","file":"tests/test_appctx.py","line":62,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 80: @app.teardown_appcontext","file":"tests/test_appctx.py","line":80,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 97: @app.teardown_appcontext","file":"tests/test_appctx.py","line":97,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 120: @app.teardown_appcontext","file":"tests/test_appctx.py","line":120,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 179: @app.teardown_appcontext","file":"tests/test_appctx.py","line":179,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 205: @app.teardown_appcontext","file":"tests/test_appctx.py","line":205,"lexical":0.65,"target":false},{"text":"File: tests/test_appctx.py\nLine 225: @app.teardown_appcontext","file":"tests/test_appctx.py","line":225,"lexical":0.65,"target":false},{"text":"File: tests/test_signals.py\nLine 174: flask.appcontext_tearing_down.connect(record_teardown, app)","file":"tests/test_signals.py","line":174,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_signals.py\nLine 181: flask.appcontext_tearing_down.disconnect(record_teardown, app)","file":"tests/test_signals.py","line":181,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"テストユーザーエラーハンドラーで、親例外を継承する新しい子例外クラスを定義してください。これは特定のエラーケースを分離するために必要です。","query":"child exception registered","file":"tests/test_user_error_handler.py","symbol":"ChildExceptionRegistered","line":68,"lang":"ja","candidates":[{"text":"File: tests/test_user_error_handler.py\nLine 65: class ChildExceptionUnregistered(ParentException):","file":"tests/test_user_error_handler.py","line":65,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 68: class ChildExceptionRegistered(ParentException):","file":"tests/test_user_error_handler.py","line":68,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 76: @app.errorhandler(ChildExceptionRegistered)","file":"tests/test_user_error_handler.py","line":76,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 78: assert isinstance(e, ChildExceptionRegistered)","file":"tests/test_user_error_handler.py","line":78,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 87: raise ChildExceptionUnregistered()","file":"tests/test_user_error_handler.py","line":87,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 91: raise ChildExceptionRegistered()","file":"tests/test_user_error_handler.py","line":91,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"verifique se os caminhos dos pacotes instalados são configurados corretamente","query":"installed package paths test","file":"tests/test_instance_config.py","symbol":"test_installed_package_paths","line":80,"lang":"pt","candidates":[{"text":"File: tests/test_instance_config.py\nLine 30: def test_uninstalled_package_paths(modules_tmp_path, purge_module):","file":"tests/test_instance_config.py","line":30,"lexical":0.65,"target":true},{"text":"File: tests/test_instance_config.py\nLine 80: def test_installed_package_paths(","file":"tests/test_instance_config.py","line":80,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"start the local flask development server with reloading and debugging options","query":"run flask dev server","file":"src/flask/cli.py","symbol":"run_command","line":935,"lang":"ja","candidates":[{"text":"File: docs/lifecycle.rst\nLine 69: ``flask run`` CLI command. When you are done with development, use a production server","file":"docs/lifecycle.rst","line":69,"lexical":0.5,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 22: ``flask run`` command to start a development server. For production, see","file":"docs/patterns/appdispatch.rst","line":22,"lexical":0.5,"target":false},{"text":"File: docs/server.rst\nLine 6: Flask provides a ``run`` command to run the application with a development server. In","file":"docs/server.rst","line":6,"lexical":0.65,"target":false},{"text":"File: docs/server.rst\nLine 21: The ``flask run`` CLI command is the recommended way to run the development server. Use","file":"docs/server.rst","line":21,"lexical":0.65,"target":false},{"text":"File: docs/server.rst\nLine 100: The development server can also be started from Python with the :meth:`Flask.run`","file":"docs/server.rst","line":100,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 83: built-in development server (``flask run``). The development server is","file":"docs/tutorial/deploy.rst","line":83,"lexical":0.5,"target":false},{"text":"File: examples/celery/README.md\nLine 18: In a separate terminal, activate the virtualenv and run the Flask development server.","file":"examples/celery/README.md","line":18,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"Como eu crio um executor para testar os comandos de CLI dessa aplicação?","query":"test cli runner","file":"examples/tutorial/tests/conftest.py","symbol":"runner","line":42,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 983: - Added ``Flask.test_cli_runner`` to create a Click runner that can","file":"CHANGES.rst","line":983,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 133: Test CLI Runner","file":"docs/api.rst","line":133,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 41: test client, and CLI runner are shown below, they can be placed in","file":"docs/testing.rst","line":41,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 80: return app.test_cli_runner()","file":"docs/testing.rst","line":80,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 248: Flask provides :meth:`~flask.Flask.test_cli_runner` to create a","file":"docs/testing.rst","line":248,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 249: :class:`~flask.testing.FlaskCliRunner`, which runs CLI commands in","file":"docs/testing.rst","line":249,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 251: object. Flask's runner extends :doc:`Click's runner `,","file":"docs/testing.rst","line":251,"lexical":0.65,"target":false},{"text":"File: docs/testing.rst\nLine 254: Use the runner's :meth:`~flask.testing.FlaskCliRunner.invoke` method to","file":"docs/testing.rst","line":254,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 107: return app.test_cli_runner()","file":"docs/tutorial/tests.rst","line":107,"lexical":0.65,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 43: \"\"\"A test runner for the app's Click commands.\"\"\"","file":"examples/tutorial/tests/conftest.py","line":43,"lexical":0.65,"target":true},{"text":"File: examples/tutorial/tests/conftest.py\nLine 44: return app.test_cli_runner()","file":"examples/tutorial/tests/conftest.py","line":44,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 62: from .testing import FlaskCliRunner","file":"src/flask/app.py","line":62,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 816: def test_cli_runner(self, **kwargs: t.Any) -> FlaskCliRunner:","file":"src/flask/app.py","line":816,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 817: \"\"\"Create a CLI runner for testing CLI commands.","file":"src/flask/app.py","line":817,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 820: Returns an instance of :attr:`test_cli_runner_class`, by default","file":"src/flask/app.py","line":820,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 821: :class:`~flask.testing.FlaskCliRunner`. The Flask app object is","file":"src/flask/app.py","line":821,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 826: cls = self.test_cli_runner_class","file":"src/flask/app.py","line":826,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 829: from .testing import FlaskCliRunner as cls","file":"src/flask/app.py","line":829,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 40: from ..testing import FlaskCliRunner","file":"src/flask/sansio/app.py","line":40,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 268: #: The :class:`~click.testing.CliRunner` subclass, by default","file":"src/flask/sansio/app.py","line":268,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 269: #: :class:`~flask.testing.FlaskCliRunner` that is used by","file":"src/flask/sansio/app.py","line":269,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 270: #: :meth:`test_cli_runner`. Its ``__init__`` method should take a","file":"src/flask/sansio/app.py","line":270,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 274: test_cli_runner_class: type[FlaskCliRunner] | None = None","file":"src/flask/sansio/app.py","line":274,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/testing.py\nLine 12: from click.testing import CliRunner","file":"src/flask/testing.py","line":12,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 266: \"\"\"A :class:`~click.testing.CliRunner` for testing a Flask app's","file":"src/flask/testing.py","line":266,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 268: :meth:`~flask.Flask.test_cli_runner`. See :ref:`testing-cli`.","file":"src/flask/testing.py","line":268,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 279: :meth:`CliRunner.invoke ` for","file":"src/flask/testing.py","line":279,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 14: from click.testing import CliRunner","file":"tests/test_cli.py","line":14,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 288: def test_app_cli_has_app_context(app, runner):","file":"tests/test_cli.py","line":288,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 338: result = runner.invoke(cli, [\"test\"], obj=obj)","file":"tests/test_cli.py","line":338,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 342: result = runner.invoke(cli, [\"subgroup\", \"test2\"], obj=obj)","file":"tests/test_cli.py","line":342,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Como faço para tornar o projeto instalável?","query":"installable project","file":"docs/tutorial/install.rst","symbol":"Make the Project Installable","line":1,"lang":"pt","candidates":[{"text":"File: docs/tutorial/install.rst\nLine 1: Make the Project Installable","file":"docs/tutorial/install.rst","line":1,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/tutorial/install.rst\nLine 4: Making your project installable means that you can build a *wheel* file and install that","file":"docs/tutorial/install.rst","line":4,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"O teste básico está retornando uma saudação estática simples em vez de validar a lógica principal do sistema.","query":"return hello world","file":"tests/test_basic.py","symbol":"index","line":97,"lang":"pt","candidates":[{"text":"File: README.md\nLine 30: return \"Hello, World!\"","file":"README.md","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 674: return 'Hello World!'","file":"docs/api.rst","line":674,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/design.rst\nLine 26: return 'Hello World!'","file":"docs/design.rst","line":26,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/design.rst\nLine 34: return 'Hello World!'","file":"docs/design.rst","line":34,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/gevent.rst\nLine 96: return f\"Hello, {request.args.get(\"name\", \"World\")}!\"","file":"docs/gevent.rst","line":96,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 29: return \"Hello, World!\"","file":"docs/lifecycle.rst","line":29,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 33: return 'Hello World!'","file":"docs/patterns/appdispatch.rst","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/packages.rst\nLine 99: return 'Hello World!'","file":"docs/patterns/packages.rst","line":99,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 171: return \"Hello world\"","file":"docs/patterns/viewdecorators.rst","line":171,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 21: return \"

Hello, World!

\"","file":"docs/quickstart.rst","line":21,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 169: return 'Hello, World'","file":"docs/quickstart.rst","line":169,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 64: return 'Hello, World!'","file":"docs/tutorial/factory.rst","line":64,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 118: function that returns a response, the string ``'Hello, World!'`` in","file":"docs/tutorial/factory.rst","line":118,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/layout.rst\nLine 32: return 'Hello, World!'","file":"docs/tutorial/layout.rst","line":32,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 163: the beginning of the tutorial. It returns \"Hello, World!\", so the test","file":"docs/tutorial/tests.rst","line":163,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 28: return \"Hello, World!\"","file":"examples/tutorial/flaskr/__init__.py","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 135: return \"Hello, World!\"","file":"src/flask/ctx.py","line":135,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/helpers.py\nLine 316: return hello('World')","file":"src/flask/helpers.py","line":316,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 353: return \"Hello, World!\"","file":"src/flask/sansio/scaffold.py","line":353,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/helloworld/hello.py\nLine 8: return \"Hello World!\"","file":"tests/test_apps/helloworld/hello.py","line":8,"lexical":0.65,"target":false},{"text":"File: tests/test_basic.py\nLine 36: return \"Hello World\"","file":"tests/test_basic.py","line":36,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_basic.py\nLine 46: return \"Hello World\"","file":"tests/test_basic.py","line":46,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 81: return \"Hello World!\"","file":"tests/test_basic.py","line":81,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 98: return \"Hello World!\"","file":"tests/test_basic.py","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 113: return \"Hello World!\"","file":"tests/test_basic.py","line":113,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 285: return \"Hello World\"","file":"tests/test_basic.py","line":285,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 307: return \"Hello World\"","file":"tests/test_basic.py","line":307,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 328: return \"Hello World\"","file":"tests/test_basic.py","line":328,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 360: return \"Hello World\"","file":"tests/test_basic.py","line":360,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1180: return app.response_class(\"Hello world\", 400), 500","file":"tests/test_basic.py","line":1180,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1701: return \"Hello World!\"","file":"tests/test_basic.py","line":1701,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 168: return \"Hello World!\"","file":"tests/test_reqctx.py","line":168,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Comment est-ce qu'on simule une erreur d'accès refusé dans les tests des routes ?","query":"flask abort 403","file":"tests/test_blueprints.py","symbol":"backend_no","line":25,"lang":"fr","candidates":[{"text":"File: tests/test_basic.py\nLine 914: flask.abort(403)","file":"tests/test_basic.py","line":914,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1010: flask.abort(403)","file":"tests/test_basic.py","line":1010,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 18: flask.abort(403)","file":"tests/test_blueprints.py","line":18,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 26: flask.abort(403)","file":"tests/test_blueprints.py","line":26,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 30: flask.abort(403)","file":"tests/test_blueprints.py","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 88: flask.abort(403)","file":"tests/test_blueprints.py","line":88,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 94: flask.abort(403)","file":"tests/test_blueprints.py","line":94,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 877: flask.abort(403)","file":"tests/test_blueprints.py","line":877,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 885: flask.abort(403)","file":"tests/test_blueprints.py","line":885,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 897: flask.abort(403)","file":"tests/test_blueprints.py","line":897,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1096: flask.abort(403)","file":"tests/test_blueprints.py","line":1096,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Wo wird geprüft, ob ein Wert ein Tupel ist?","query":"isinstance tuple","file":"src/flask/json/tag.py","symbol":"check","line":137,"lang":"de","candidates":[{"text":"File: src/flask/app.py\nLine 1288: if isinstance(rv, tuple):","file":"src/flask/app.py","line":1288,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1296: if isinstance(rv[1], (Headers, dict, tuple, list)):","file":"src/flask/app.py","line":1296,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/debughelpers.py\nLine 112: if isinstance(value, (tuple, list)):","file":"src/flask/debughelpers.py","line":112,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/json/tag.py\nLine 138: return isinstance(value, tuple)","file":"src/flask/json/tag.py","line":138,"lexical":0.39999999999999997,"target":true}]} {"site":"project_search","repo":"flask","task":"Where is the directory for compiled artifacts defined?","query":"BUILDDIR _build","file":"docs/Makefile","symbol":"BUILDDIR","line":9,"lang":"en","candidates":[{"text":"File: docs/Makefile\nLine 9: BUILDDIR = _build","file":"docs/Makefile","line":9,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/make.bat\nLine 11: set BUILDDIR=_build","file":"docs/make.bat","line":11,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Por que o método que define a idade máxima do cache para arquivos enviados retorna sempre o valor 100, independentemente do nome do arquivo?","query":"send file max age","file":"tests/test_blueprints.py","symbol":"get_send_file_max_age","line":223,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 195: - The ``session_cookie_name``, ``send_file_max_age_default``, ``use_x_sendfile``,","file":"CHANGES.rst","line":195,"lexical":0.5,"target":false},{"text":"File: CHANGES.rst\nLine 312: ``session_cookie_name``, ``send_file_max_age_default``,","file":"CHANGES.rst","line":312,"lexical":0.5,"target":false},{"text":"File: CHANGES.rst\nLine 548: ``get_send_file_max_age``. :issue:`4044`, :pr:`4026`","file":"CHANGES.rst","line":548,"lexical":0.5,"target":false},{"text":"File: CHANGES.rst\nLine 632: - ``send_file`` sets ``conditional=True`` and ``max_age=None`` by","file":"CHANGES.rst","line":632,"lexical":0.5,"target":false},{"text":"File: CHANGES.rst\nLine 1337: - ``Flask`` and ``Blueprint`` now provide a ``get_send_file_max_age``","file":"CHANGES.rst","line":1337,"lexical":0.5,"target":false},{"text":"File: CHANGES.rst\nLine 1342: controls by file extension. The default max-age for ``send_file``","file":"CHANGES.rst","line":1342,"lexical":0.5,"target":false},{"text":"File: CHANGES.rst\nLine 1344: ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is used","file":"CHANGES.rst","line":1344,"lexical":0.5,"target":false},{"text":"File: CHANGES.rst\nLine 1345: in the default ``get_send_file_max_age`` implementation.","file":"CHANGES.rst","line":1345,"lexical":0.5,"target":false},{"text":"File: docs/config.rst\nLine 250: .. py:data:: SEND_FILE_MAX_AGE_DEFAULT","file":"docs/config.rst","line":250,"lexical":0.5,"target":false},{"text":"File: docs/config.rst\nLine 255: :meth:`~flask.Flask.get_send_file_max_age` on the application or","file":"docs/config.rst","line":255,"lexical":0.5,"target":false},{"text":"File: src/flask/app.py\nLine 230: \"SEND_FILE_MAX_AGE_DEFAULT\": None,","file":"src/flask/app.py","line":230,"lexical":0.5,"target":false},{"text":"File: src/flask/app.py\nLine 366: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/app.py","line":366,"lexical":0.5,"target":false},{"text":"File: src/flask/app.py\nLine 367: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/app.py","line":367,"lexical":0.5,"target":false},{"text":"File: src/flask/app.py\nLine 370: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/app.py","line":370,"lexical":0.5,"target":false},{"text":"File: src/flask/app.py\nLine 383: value = self.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/app.py","line":383,"lexical":0.5,"target":false},{"text":"File: src/flask/app.py\nLine 408: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/app.py","line":408,"lexical":0.5,"target":false},{"text":"File: src/flask/app.py\nLine 410: max_age = self.get_send_file_max_age(filename)","file":"src/flask/app.py","line":410,"lexical":0.5,"target":false},{"text":"File: src/flask/blueprints.py\nLine 55: def get_send_file_max_age(self, filename: str | None) -> int | None:","file":"src/flask/blueprints.py","line":55,"lexical":0.5,"target":false},{"text":"File: src/flask/blueprints.py\nLine 56: \"\"\"Used by :func:`send_file` to determine the ``max_age`` cache","file":"src/flask/blueprints.py","line":56,"lexical":0.5,"target":false},{"text":"File: src/flask/blueprints.py\nLine 59: By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from","file":"src/flask/blueprints.py","line":59,"lexical":0.5,"target":false},{"text":"File: src/flask/blueprints.py\nLine 72: value = current_app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"src/flask/blueprints.py","line":72,"lexical":0.5,"target":false},{"text":"File: src/flask/blueprints.py\nLine 97: # send_file only knows to call get_send_file_max_age on the app,","file":"src/flask/blueprints.py","line":97,"lexical":0.5,"target":false},{"text":"File: src/flask/blueprints.py\nLine 99: max_age = self.get_send_file_max_age(filename)","file":"src/flask/blueprints.py","line":99,"lexical":0.5,"target":false},{"text":"File: src/flask/helpers.py\nLine 406: kwargs[\"max_age\"] = ctx.app.get_send_file_max_age","file":"src/flask/helpers.py","line":406,"lexical":0.5,"target":false},{"text":"File: src/flask/helpers.py\nLine 515: :meth:`Flask.get_send_file_max_age`.","file":"src/flask/helpers.py","line":515,"lexical":0.5,"target":false},{"text":"File: tests/test_blueprints.py\nLine 194: max_age_default = app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"]","file":"tests/test_blueprints.py","line":194,"lexical":0.5,"target":true},{"text":"File: tests/test_blueprints.py\nLine 197: if app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] == expected_max_age:","file":"tests/test_blueprints.py","line":197,"lexical":0.5,"target":false},{"text":"File: tests/test_blueprints.py\nLine 199: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = expected_max_age","file":"tests/test_blueprints.py","line":199,"lexical":0.5,"target":false},{"text":"File: tests/test_blueprints.py\nLine 204: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = max_age_default","file":"tests/test_blueprints.py","line":204,"lexical":0.5,"target":false},{"text":"File: tests/test_blueprints.py\nLine 223: def get_send_file_max_age(self, filename):","file":"tests/test_blueprints.py","line":223,"lexical":0.5,"target":false},{"text":"File: tests/test_helpers.py\nLine 55: app.config[\"SEND_FILE_MAX_AGE_DEFAULT\"] = 3600","file":"tests/test_helpers.py","line":55,"lexical":0.5,"target":false},{"text":"File: tests/test_helpers.py\nLine 70: def get_send_file_max_age(self, filename):","file":"tests/test_helpers.py","line":70,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"O guia de depuração não menciona como configurar ou utilizar depuradores externos ao ambiente padrão.","query":"external debuggers","file":"docs/debugging.rst","symbol":"External Debuggers","line":60,"lang":"pt","candidates":[{"text":"File: docs/debugging.rst\nLine 60: External Debuggers","file":"docs/debugging.rst","line":60,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/debugging.rst\nLine 63: External debuggers, such as those provided by IDEs, can offer a more","file":"docs/debugging.rst","line":63,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"修复测试环境中的应用实例初始化逻辑,目前创建的 Web 服务名称与预期不符。","query":"Flask app factory","file":"tests/test_cli.py","symbol":"create_app","line":103,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 605: - When specifying a factory function with ``FLASK_APP``, keyword","file":"CHANGES.rst","line":605,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 901: - ``FLASK_APP`` can be set to an app factory, with arguments if","file":"CHANGES.rst","line":901,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 101: When using the Flask application factory pattern, call the ``celery_init_app`` function","file":"docs/patterns/celery.rst","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 103: can be used to get the Celery app from the Flask app returned by the factory.","file":"docs/patterns/celery.rst","line":103,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 28: contain the application factory, and it tells Python that the ``flaskr``","file":"docs/tutorial/factory.rst","line":28,"lexical":0.65,"target":false},{"text":"File: src/flask/cli.py\nLine 88: \"Failed to find Flask application or factory in module\"","file":"src/flask/cli.py","line":88,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 457: \"The Flask application or factory function to load, in the form 'module:name'.\"","file":"src/flask/cli.py","line":457,"lexical":0.55,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Cómo se hace la instalación de este módulo?","query":"mod_wsgi install","file":"docs/deploying/mod_wsgi.rst","symbol":"Installing","line":23,"lang":"es","candidates":[{"text":"File: docs/deploying/mod_wsgi.rst\nLine 26: Installing mod_wsgi requires a compiler and the Apache server and","file":"docs/deploying/mod_wsgi.rst","line":26,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/deploying/mod_wsgi.rst\nLine 39: $ pip install mod_wsgi","file":"docs/deploying/mod_wsgi.rst","line":39,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"Where is the generator that yields a greeting string mixed with a name from the query parameters?","query":"yield flask request args","file":"tests/test_helpers.py","symbol":"generate","line":276,"lang":"en","candidates":[{"text":"File: tests/test_helpers.py\nLine 234: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":234,"lexical":0.5,"target":true},{"text":"File: tests/test_helpers.py\nLine 248: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":248,"lexical":0.5,"target":false},{"text":"File: tests/test_helpers.py\nLine 278: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":278,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"busca la función que devuelve un error de prohibición en las pruebas de las plantillas","query":"flask abort 403","file":"tests/test_blueprints.py","symbol":"sideend_no","line":29,"lang":"es","candidates":[{"text":"File: tests/test_basic.py\nLine 914: flask.abort(403)","file":"tests/test_basic.py","line":914,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1010: flask.abort(403)","file":"tests/test_basic.py","line":1010,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 18: flask.abort(403)","file":"tests/test_blueprints.py","line":18,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 26: flask.abort(403)","file":"tests/test_blueprints.py","line":26,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 30: flask.abort(403)","file":"tests/test_blueprints.py","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 88: flask.abort(403)","file":"tests/test_blueprints.py","line":88,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 94: flask.abort(403)","file":"tests/test_blueprints.py","line":94,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 877: flask.abort(403)","file":"tests/test_blueprints.py","line":877,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 885: flask.abort(403)","file":"tests/test_blueprints.py","line":885,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 897: flask.abort(403)","file":"tests/test_blueprints.py","line":897,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1096: flask.abort(403)","file":"tests/test_blueprints.py","line":1096,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"trouve la fonction qui vérifie si une valeur est un booléen","query":"is boolean","file":"tests/test_templating.py","symbol":"is_boolean","line":296,"lang":"fr","candidates":[{"text":"File: tests/templates/template_test.html\nLine 1: {% if value is boolean %}","file":"tests/templates/template_test.html","line":1,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 514: def is_boolean(value):","file":"tests/test_blueprints.py","line":514,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 530: assert \"is_boolean\" in app.jinja_env.tests.keys()","file":"tests/test_blueprints.py","line":530,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 531: assert app.jinja_env.tests[\"is_boolean\"] == is_boolean","file":"tests/test_blueprints.py","line":531,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 532: assert app.jinja_env.tests[\"is_boolean\"](False)","file":"tests/test_blueprints.py","line":532,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 550: def is_boolean(value):","file":"tests/test_blueprints.py","line":550,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 553: bp.add_app_template_test(is_boolean)","file":"tests/test_blueprints.py","line":553,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 555: assert \"is_boolean\" in app.jinja_env.tests.keys()","file":"tests/test_blueprints.py","line":555,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 556: assert app.jinja_env.tests[\"is_boolean\"] == is_boolean","file":"tests/test_blueprints.py","line":556,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 557: assert app.jinja_env.tests[\"is_boolean\"](False)","file":"tests/test_blueprints.py","line":557,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 564: def is_boolean(value):","file":"tests/test_blueprints.py","line":564,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 569: assert app.jinja_env.tests[\"boolean\"] == is_boolean","file":"tests/test_blueprints.py","line":569,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 576: def is_boolean(value):","file":"tests/test_blueprints.py","line":576,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 579: bp.add_app_template_test(is_boolean, \"boolean\")","file":"tests/test_blueprints.py","line":579,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 582: assert app.jinja_env.tests[\"boolean\"] == is_boolean","file":"tests/test_blueprints.py","line":582,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 640: def is_boolean(value):","file":"tests/test_blueprints.py","line":640,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 656: def is_boolean(value):","file":"tests/test_blueprints.py","line":656,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_blueprints.py\nLine 659: bp.add_app_template_test(is_boolean, \"boolean\")","file":"tests/test_blueprints.py","line":659,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 287: def is_boolean(value):","file":"tests/test_templating.py","line":287,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_templating.py\nLine 291: assert app.jinja_env.tests[\"boolean\"] == is_boolean","file":"tests/test_templating.py","line":291,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 296: def is_boolean(value):","file":"tests/test_templating.py","line":296,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 299: app.add_template_test(is_boolean, \"boolean\")","file":"tests/test_templating.py","line":299,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 301: assert app.jinja_env.tests[\"boolean\"] == is_boolean","file":"tests/test_templating.py","line":301,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 334: def is_boolean(value):","file":"tests/test_templating.py","line":334,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 346: def is_boolean(value):","file":"tests/test_templating.py","line":346,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_templating.py\nLine 349: app.add_template_test(is_boolean, \"boolean\")","file":"tests/test_templating.py","line":349,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"我想在数据库里建一个帖子表,包含自增的主键、关联用户的ID、创建时间以及帖子的标题和正文,并且要确保用户ID是外键关联到用户表的ID。","query":"create post table","file":"examples/tutorial/flaskr/schema.sql","symbol":"post","line":13,"lang":"zh","candidates":[{"text":"File: docs/tutorial/database.rst\nLine 93: in the ``user`` table, and posts in the ``post`` table. Create a file","file":"docs/tutorial/database.rst","line":93,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/database.rst\nLine 108: CREATE TABLE post (","file":"docs/tutorial/database.rst","line":108,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/schema.sql\nLine 13: CREATE TABLE post (","file":"examples/tutorial/flaskr/schema.sql","line":13,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"retorna a url atual do pedido","query":"request url","file":"tests/test_testing.py","symbol":"index","line":91,"lang":"pt","candidates":[{"text":"File: CHANGES.rst\nLine 779: - URL matching now occurs after the request context is pushed, rather","file":"CHANGES.rst","line":779,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1177: in the test client when absolute URLs were requested.","file":"CHANGES.rst","line":1177,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1332: also adds support for URL generation without an active request","file":"CHANGES.rst","line":1332,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 416: f\"SecurityException at {request.url!r}\",","file":"docs/api.rst","line":416,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/blueprints.rst\nLine 53: blueprints when dispatching requests and generating URLs from one endpoint","file":"docs/blueprints.rst","line":53,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/config.rst\nLine 316: Use this scheme for generating external URLs when not in a request context.","file":"docs/config.rst","line":316,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 89: request URL is matched. It is passed the instance of the error being handled,","file":"docs/errorhandling.rst","line":89,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 415: # if a request is in our blog URL space","file":"docs/errorhandling.rst","line":415,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 170: a request, such as templates, building URLs, or handling JSON data. See the rest of this","file":"docs/lifecycle.rst","line":170,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/logging.rst\nLine 129: record.url = request.url","file":"docs/logging.rst","line":129,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/logging.rst\nLine 138: '[%(asctime)s] %(remote_addr)s requested %(url)s\\n'","file":"docs/logging.rst","line":138,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 22: from flask import Flask, flash, request, redirect, url_for","file":"docs/patterns/fileuploads.rst","line":22,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 56: return redirect(request.url)","file":"docs/patterns/fileuploads.rst","line":56,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 62: return redirect(request.url)","file":"docs/patterns/fileuploads.rst","line":62,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 20: request, url_for","file":"docs/patterns/flashing.rst","line":20,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 66: request for it. First, you need to know the URL to request.","file":"docs/patterns/javascript.rst","line":66,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/urlprocessors.rst\nLine 60: after the request was matched and can execute code based on the URL","file":"docs/patterns/urlprocessors.rst","line":60,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 28: from flask import g, request, redirect, url_for","file":"docs/patterns/viewdecorators.rst","line":28,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/viewdecorators.rst\nLine 34: return redirect(url_for('login', next=request.url))","file":"docs/patterns/viewdecorators.rst","line":34,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 259: to try out :func:`~flask.url_for`. :meth:`~flask.Flask.test_request_context`","file":"docs/quickstart.rst","line":259,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 24: Blueprint, flash, g, redirect, render_template, request, url_for","file":"docs/tutorial/blog.rst","line":24,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 7: application. Flask uses patterns to match the incoming request URL to","file":"docs/tutorial/views.rst","line":7,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 33: Blueprint, flash, g, redirect, render_template, request, session, url_for","file":"docs/tutorial/views.rst","line":33,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/web-security.rst\nLine 118: Say you have a specific URL that, when you sent ``POST`` requests to will","file":"docs/web-security.rst","line":118,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/javascript/js_example/templates/xhr.html\nLine 16: request.open('POST', {{ url_for('add')|tojson }});","file":"examples/javascript/js_example/templates/xhr.html","line":16,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 510: def create_url_adapter(self, request: Request | None) -> MapAdapter | None:","file":"src/flask/app.py","line":510,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 511: \"\"\"Creates a URL adapter for the given request. The URL adapter","file":"src/flask/app.py","line":511,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 525: This can be called outside a request when the URL adapter is created","file":"src/flask/app.py","line":525,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 970: \"\"\"Does the request dispatching. Matches the URL and returns the","file":"src/flask/app.py","line":970,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1129: not in an active request, URLs will be external by default, but","file":"src/flask/app.py","line":1129,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1154: request, URLs are external by default.","file":"src/flask/app.py","line":1154,"lexical":0.39999999999999997,"target":false},{"text":"File: src/flask/app.py\nLine 1174: # When in a request, generate a URL without scheme and","file":"src/flask/app.py","line":1174,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"show documentation for finding installed applications","query":"app discovery","file":"docs/cli.rst","symbol":"Application Discovery","line":14,"lang":"en","candidates":[{"text":"File: docs/cli.rst\nLine 14: Application Discovery","file":"docs/cli.rst","line":14,"lexical":0.39999999999999997,"target":true},{"text":"File: docs/quickstart.rst\nLine 52: .. admonition:: Application Discovery Behavior","file":"docs/quickstart.rst","line":52,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"The rendering process for templates is triggering a side effect that sends the rendered result to a separate handler, but it's doing so alongside a generator that yields the content. I need to verify if this signal is being sent correctly during the asynchronous lifecycle and if it correctly handles the synchronization of the application context.","query":"template render signal","file":"src/flask/templating.py","symbol":"generate","line":172,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 1099: - Added before_render_template signal.","file":"CHANGES.rst","line":1099,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 333: This signal is sent when a template was successfully rendered. The","file":"docs/api.rst","line":333,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 350: This signal is sent before template rendering process. The","file":"docs/api.rst","line":350,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/__init__.py\nLine 27: from .signals import before_render_template as before_render_template","file":"src/flask/__init__.py","line":27,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/__init__.py\nLine 33: from .signals import template_rendered as template_rendered","file":"src/flask/__init__.py","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/signals.py\nLine 8: template_rendered = _signals.signal(\"template-rendered\")","file":"src/flask/signals.py","line":8,"lexical":0.65,"target":false},{"text":"File: src/flask/signals.py\nLine 9: before_render_template = _signals.signal(\"before-render-template\")","file":"src/flask/signals.py","line":9,"lexical":0.65,"target":false},{"text":"File: src/flask/templating.py\nLine 13: from .signals import before_render_template","file":"src/flask/templating.py","line":13,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/templating.py\nLine 14: from .signals import template_rendered","file":"src/flask/templating.py","line":14,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"例外処理のテストを書いているのですが、独自の例外クラスが渡されたときに特定の文字列を返す仕組みがどこにあるか教えてください。エラーハンドリングの挙動を確認したいです。","query":"custom exception handler","file":"tests/test_user_error_handler.py","symbol":"custom_exception_handler","line":15,"lang":"ja","candidates":[{"text":"File: tests/test_user_error_handler.py\nLine 14: @app.errorhandler(CustomException)","file":"tests/test_user_error_handler.py","line":14,"lexical":0.65,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 15: def custom_exception_handler(e):","file":"tests/test_user_error_handler.py","line":15,"lexical":0.65,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 20: app.register_error_handler(CustomException(), None)","file":"tests/test_user_error_handler.py","line":20,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"如何获取当前的HTTP请求方法?","query":"request method","file":"tests/test_basic.py","symbol":"more","line":138,"lang":"zh","candidates":[{"text":"File: CHANGES.rst\nLine 12: - Many ``Flask`` methods involved in request dispatch now take the current","file":"CHANGES.rst","line":12,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 928: - Add ``json`` keyword argument for the test client request methods.","file":"CHANGES.rst","line":928,"lexical":0.39999999999999997,"target":false},{"text":"File: CHANGES.rst\nLine 1414: - HEAD requests to a method view now automatically dispatch to the","file":"CHANGES.rst","line":1414,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/api.rst\nLine 671: if request.method == 'OPTIONS':","file":"docs/api.rst","line":671,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 148: If a route receives an unallowed request method, a \"405 Method Not Allowed\"","file":"docs/errorhandling.rst","line":148,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 425: # if a request has the wrong method to our API","file":"docs/errorhandling.rst","line":425,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/lifecycle.rst\nLine 42: error if setup-related methods are called after requests are handled. In that case","file":"docs/lifecycle.rst","line":42,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/fileuploads.rst\nLine 52: if request.method == 'POST':","file":"docs/patterns/fileuploads.rst","line":52,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/flashing.rst\nLine 32: if request.method == 'POST':","file":"docs/patterns/flashing.rst","line":32,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/javascript.rst\nLine 10: requests from a page. You may have heard of other \"AJAX\" methods and","file":"docs/patterns/javascript.rst","line":10,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/methodoverrides.rst\nLine 32: environ['REQUEST_METHOD'] = method","file":"docs/patterns/methodoverrides.rst","line":32,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/wtforms.rst\nLine 49: if request.method == 'POST' and form.validate():","file":"docs/patterns/wtforms.rst","line":49,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 258: For example, here we use the :meth:`~flask.Flask.test_request_context` method","file":"docs/quickstart.rst","line":258,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 298: a route only answers to ``GET`` requests. You can use the ``methods`` argument","file":"docs/quickstart.rst","line":298,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 306: if request.method == 'POST':","file":"docs/quickstart.rst","line":306,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 455: attributes and methods to work with the incoming request data, but here is a","file":"docs/quickstart.rst","line":455,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 468: The current request method is available in the :attr:`~.Request.method`","file":"docs/quickstart.rst","line":468,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 479: if request.method == \"POST\":","file":"docs/quickstart.rst","line":479,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 485: # Executed if the request method was GET or the credentials were invalid.","file":"docs/quickstart.rst","line":485,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 502: For a full list of methods and attributes of the request object, see the","file":"docs/quickstart.rst","line":502,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 526: if request.method == 'POST':","file":"docs/quickstart.rst","line":526,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 544: if request.method == 'POST':","file":"docs/quickstart.rst","line":544,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/quickstart.rst\nLine 747: if request.method == 'POST':","file":"docs/quickstart.rst","line":747,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/shell.rst\nLine 22: using the :attr:`~flask.Flask.test_request_context` method which creates","file":"docs/shell.rst","line":22,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 91: The ``client`` has methods that match the common HTTP request methods,","file":"docs/testing.rst","line":91,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 97: To make a request, call the method the request should use with the path","file":"docs/testing.rst","line":97,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 183: is a redirect. By passing ``follow_redirects=True`` to a request method,","file":"docs/testing.rst","line":183,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 295: takes the same arguments as the test client's request methods.","file":"docs/testing.rst","line":295,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 148: if request.method == 'POST':","file":"docs/tutorial/blog.rst","line":148,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/blog.rst\nLine 236: if request.method == 'POST':","file":"docs/tutorial/blog.rst","line":236,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 84: if request.method == 'POST':","file":"docs/tutorial/views.rst","line":84,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/tutorial/views.rst\nLine 119: :attr:`request.method ` will be ``'POST'``. In this","file":"docs/tutorial/views.rst","line":119,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"jinja2 템플릿에서 사용자 정의 필터를 적용하고, 해당 템플릿을 렌더링한 결과가 예상대로 뒤집힌 문자열인지 검증하는 테스트를 찾아줘.","query":"template filter test","file":"tests/test_templating.py","symbol":"test_template_filter_with_name_and_template","line":214,"lang":"ko","candidates":[{"text":"File: CHANGES.rst\nLine 20: - ``template_filter``, ``template_test``, and ``template_global`` decorators","file":"CHANGES.rst","line":20,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/templating.rst\nLine 144: filters, tests, and global functions for use in Jinja templates. They all follow","file":"docs/templating.rst","line":144,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 350: def test_template_filter(app):","file":"tests/test_blueprints.py","line":350,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 387: def test_add_template_filter(app):","file":"tests/test_blueprints.py","line":387,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 400: def test_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":400,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 413: def test_add_template_filter_with_name(app):","file":"tests/test_blueprints.py","line":413,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 426: def test_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":426,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 443: def test_template_filter_after_route_with_template(app, client):","file":"tests/test_blueprints.py","line":443,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 459: def test_add_template_filter_with_template(app, client):","file":"tests/test_blueprints.py","line":459,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 476: def test_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":476,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 493: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_blueprints.py","line":493,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 123: def test_template_filter(app):","file":"tests/test_templating.py","line":123,"lexical":0.65,"target":true},{"text":"File: tests/test_templating.py\nLine 157: def test_add_template_filter(app):","file":"tests/test_templating.py","line":157,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 167: def test_template_filter_with_name(app):","file":"tests/test_templating.py","line":167,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 177: def test_add_template_filter_with_name(app):","file":"tests/test_templating.py","line":177,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 187: def test_template_filter_with_template(app, client):","file":"tests/test_templating.py","line":187,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 200: def test_add_template_filter_with_template(app, client):","file":"tests/test_templating.py","line":200,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 214: def test_template_filter_with_name_and_template(app, client):","file":"tests/test_templating.py","line":214,"lexical":0.65,"target":false},{"text":"File: tests/test_templating.py\nLine 227: def test_add_template_filter_with_name_and_template(app, client):","file":"tests/test_templating.py","line":227,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Estoy configurando los endpoints de la aplicación. ¿Dónde está el decorador que se usa para asignar una ruta de URL a una función de vista?","query":"url route decorator","file":"src/flask/sansio/scaffold.py","symbol":"route","line":344,"lang":"es","candidates":[{"text":"File: docs/quickstart.rst\nLine 161: Use the :meth:`~flask.Flask.route` decorator to bind a function to a URL. ::","file":"docs/quickstart.rst","line":161,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 385: URLs. The :meth:`route` decorator is a shortcut to call this","file":"src/flask/sansio/scaffold.py","line":385,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"Wo wird die Flask-Instanz für die Anwendung initialisiert?","query":"flask app factory","file":"tests/test_cli.py","symbol":"create_app","line":348,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 605: - When specifying a factory function with ``FLASK_APP``, keyword","file":"CHANGES.rst","line":605,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 901: - ``FLASK_APP`` can be set to an app factory, with arguments if","file":"CHANGES.rst","line":901,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 101: When using the Flask application factory pattern, call the ``celery_init_app`` function","file":"docs/patterns/celery.rst","line":101,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 103: can be used to get the Celery app from the Flask app returned by the factory.","file":"docs/patterns/celery.rst","line":103,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 28: contain the application factory, and it tells Python that the ``flaskr``","file":"docs/tutorial/factory.rst","line":28,"lexical":0.65,"target":false},{"text":"File: src/flask/cli.py\nLine 88: \"Failed to find Flask application or factory in module\"","file":"src/flask/cli.py","line":88,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 457: \"The Flask application or factory function to load, in the form 'module:name'.\"","file":"src/flask/cli.py","line":457,"lexical":0.55,"target":false}]} {"site":"project_search","repo":"flask","task":"이 앱의 테스트용 클라이언트 객체를 얻는 방법이 궁금해.","query":"test client fixture","file":"examples/tutorial/tests/conftest.py","symbol":"client","line":36,"lang":"ko","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 122: object created by the ``app`` fixture. Tests will use the client to make","file":"docs/tutorial/tests.rst","line":122,"lexical":0.65,"target":false},{"text":"File: tests/test_reqctx.py\nLine 148: request: pytest.FixtureRequest, app: flask.Flask, client: FlaskClient","file":"tests/test_reqctx.py","line":148,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"Como registro uma função personalizada do Jinja como um teste disponível em todos os templates da aplicação, podendo usá-la como decorador ou chamando diretamente?","query":"register app template test","file":"src/flask/sansio/blueprints.py","symbol":"app_template_test","line":504,"lang":"pt","candidates":[{"text":"File: src/flask/sansio/blueprints.py\nLine 510: The :meth:`add_app_template_test` method may be used to register a","file":"src/flask/sansio/blueprints.py","line":510,"lexical":0.5,"target":true},{"text":"File: src/flask/sansio/blueprints.py\nLine 537: The :meth:`app_template_test` decorator can be used to register a","file":"src/flask/sansio/blueprints.py","line":537,"lexical":0.5,"target":false}]} {"site":"project_search","repo":"flask","task":"상속 관련 테스트를 작성 중인데, 예외가 발생했을 때 컨텍스트와 함께 에러 정보를 기록하는 메서드가 정의되어 있는지 확인하고 싶어요. 구현부가 비어 있는 코드가 어디에 있는지 알려주세요.","query":"log exception ctx","file":"tests/test_subclassing.py","symbol":"log_exception","line":8,"lang":"ko","candidates":[{"text":"File: src/flask/app.py\nLine 943: self.log_exception(ctx, exc_info)","file":"src/flask/app.py","line":943,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_subclassing.py\nLine 8: def log_exception(self, ctx, exc_info):","file":"tests/test_subclassing.py","line":8,"lexical":0.44999999999999996,"target":true}]} {"site":"project_search","repo":"flask","task":"how do I run a command-line interface command within a test environment for this app?","query":"test cli invoke","file":"src/flask/testing.py","symbol":"invoke","line":275,"lang":"en","candidates":[{"text":"File: CHANGES.rst\nLine 984: invoke Flask CLI commands for testing. :pr:`2636`","file":"CHANGES.rst","line":984,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/testing.rst\nLine 254: Use the runner's :meth:`~flask.testing.FlaskCliRunner.invoke` method to","file":"docs/testing.rst","line":254,"lexical":0.65,"target":false},{"text":"File: src/flask/testing.py\nLine 279: :meth:`CliRunner.invoke ` for","file":"src/flask/testing.py","line":279,"lexical":0.65,"target":true},{"text":"File: tests/test_cli.py\nLine 338: result = runner.invoke(cli, [\"test\"], obj=obj)","file":"tests/test_cli.py","line":338,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 342: result = runner.invoke(cli, [\"subgroup\", \"test2\"], obj=obj)","file":"tests/test_cli.py","line":342,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 359: result = runner.invoke(cli, [\"test\"])","file":"tests/test_cli.py","line":359,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 379: result = runner.invoke(cli, [\"test\"])","file":"tests/test_cli.py","line":379,"lexical":0.65,"target":false},{"text":"File: tests/test_cli.py\nLine 697: result = app.test_cli_runner().invoke(args=[\"blue\", \"--help\"])","file":"tests/test_cli.py","line":697,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 352: def test_cli_invoke(app):","file":"tests/test_testing.py","line":352,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"¿Cómo se define la representación en string de esta clase?","query":"flask.g repr","file":"src/flask/ctx.py","symbol":"__repr__","line":111,"lang":"es","candidates":[{"text":"File: tests/test_appctx.py\nLine 159: assert repr(flask.g) == \"\"","file":"tests/test_appctx.py","line":159,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 1514: assert repr(flask.g) == \"\"","file":"tests/test_basic.py","line":1514,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Die Anwendung stürzt ab, wenn der Parameter für den Namen in der URL fehlt, anstatt eine Fehlermeldung zurückzugeben.","query":"flask request args","file":"tests/test_reqctx.py","symbol":"index","line":108,"lang":"de","candidates":[{"text":"File: docs/patterns/wtforms.rst\nLine 65: :attr:`~flask.request.args` if the data is submitted as ``GET``.","file":"docs/patterns/wtforms.rst","line":65,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/quickstart.rst\nLine 147: name = request.args.get(\"name\", \"Flask\")","file":"docs/quickstart.rst","line":147,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 234: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":234,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 248: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":248,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 278: yield flask.request.args[\"name\"]","file":"tests/test_helpers.py","line":278,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 109: return f\"Hello {flask.request.args['name']}!\"","file":"tests/test_reqctx.py","line":109,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_reqctx.py\nLine 137: return f\"Hello {flask.request.args['name']}!\"","file":"tests/test_reqctx.py","line":137,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 162: assert flask.request.args[\"foo\"] == \"bar\"","file":"tests/test_reqctx.py","line":162,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 262: assert \"vodka\" in flask.request.args","file":"tests/test_testing.py","line":262,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"チュートリアル内のテストカバレッジに関する記述が、現在のドキュメント構成と一致していない可能性があります。確認してください。","query":"test coverage","file":"docs/tutorial/tests.rst","symbol":"Test Coverage","line":3,"lang":"ja","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 3: Test Coverage","file":"docs/tutorial/tests.rst","line":3,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/tutorial/tests.rst\nLine 19: application in the browser. Despite this, test coverage is an important","file":"docs/tutorial/tests.rst","line":19,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 26: You'll use `pytest`_ and `coverage`_ to test and measure your code.","file":"docs/tutorial/tests.rst","line":26,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 31: $ pip install pytest coverage","file":"docs/tutorial/tests.rst","line":31,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 493: Some extra configuration, which is not required but makes running tests with coverage","file":"docs/tutorial/tests.rst","line":493,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 528: To measure the code coverage of your tests, use the ``coverage`` command","file":"docs/tutorial/tests.rst","line":528,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 533: $ coverage run -m pytest","file":"docs/tutorial/tests.rst","line":533,"lexical":0.6000000000000001,"target":false},{"text":"File: examples/javascript/README.rst\nLine 47: $ coverage run -m pytest","file":"examples/javascript/README.rst","line":47,"lexical":0.39999999999999997,"target":false},{"text":"File: examples/tutorial/README.rst\nLine 66: $ coverage run -m pytest","file":"examples/tutorial/README.rst","line":66,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"servir un fichier statique depuis le dossier statique","query":"send static file","file":"src/flask/app.py","symbol":"send_static_file","line":393,"lang":"fr","candidates":[{"text":"File: CHANGES.rst\nLine 1339: from Flask when using ``Flask.send_static_file`` (used for the","file":"CHANGES.rst","line":1339,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1340: default static file handler) and ``helpers.send_file``. This hook is","file":"CHANGES.rst","line":1340,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1473: - Use Last-Modified for static file sending instead of Date which was","file":"CHANGES.rst","line":1473,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/singlepageapplications.rst\nLine 24: return app.send_static_file(\"index.html\")","file":"docs/patterns/singlepageapplications.rst","line":24,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 363: view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore","file":"src/flask/app.py","line":363,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 393: def send_static_file(self, filename: str) -> Response:","file":"src/flask/app.py","line":393,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/blueprints.py\nLine 82: def send_static_file(self, filename: str) -> Response:","file":"src/flask/blueprints.py","line":82,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 326: view_func=self.send_static_file, # type: ignore[attr-defined]","file":"src/flask/sansio/blueprints.py","line":326,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 231: with app.test_request_context(), blueprint.send_static_file(\"index.html\") as rv:","file":"tests/test_blueprints.py","line":231,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 38: with flask.send_file(\"static/index.html\") as rv:","file":"tests/test_helpers.py","line":38,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 48: with app.send_static_file(\"index.html\") as rv:","file":"tests/test_helpers.py","line":48,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 52: with flask.send_file(\"static/index.html\") as rv:","file":"tests/test_helpers.py","line":52,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 58: with app.send_static_file(\"index.html\") as rv:","file":"tests/test_helpers.py","line":58,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 62: with flask.send_file(\"static/index.html\") as rv:","file":"tests/test_helpers.py","line":62,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 66: with app.send_static_file(FakePath(\"index.html\")) as rv:","file":"tests/test_helpers.py","line":66,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 77: with app.send_static_file(\"index.html\") as rv:","file":"tests/test_helpers.py","line":77,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_helpers.py\nLine 81: with flask.send_file(\"static/index.html\") as rv:","file":"tests/test_helpers.py","line":81,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"erzeuge die flask instanz für die tests","query":"flask create app","file":"tests/test_cli.py","symbol":"create_app","line":74,"lang":"de","candidates":[{"text":"File: CHANGES.rst\nLine 902: needed, for example ``FLASK_APP=myproject.app:create_app('dev')``.","file":"CHANGES.rst","line":902,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/cli.rst\nLine 492: @click.group(cls=FlaskGroup, create_app=create_app)","file":"docs/cli.rst","line":492,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 102: $ flask --app 'hello:create_app(local_auth=True)' run","file":"docs/patterns/appfactories.rst","line":102,"lexical":0.65,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 39: and registers tasks. While creating a Flask app, use the following code to create and","file":"docs/patterns/celery.rst","line":39,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 107: def create_app() -> Flask:","file":"docs/patterns/celery.rst","line":107,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 121: available. Create a ``make_celery.py`` file that calls the Flask app factory and gets","file":"docs/patterns/celery.rst","line":121,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/patterns/celery.rst\nLine 128: flask_app = create_app()","file":"docs/patterns/celery.rst","line":128,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/deploy.rst\nLine 100: $ waitress-serve --call 'flaskr:create_app'","file":"docs/tutorial/deploy.rst","line":100,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 10: The most straightforward way to create a Flask application is to create","file":"docs/tutorial/factory.rst","line":10,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 71: #. ``app = Flask(__name__, instance_relative_config=True)`` creates the","file":"docs/tutorial/factory.rst","line":71,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/factory.rst\nLine 115: #. :meth:`@app.route() ` creates a simple route so you can","file":"docs/tutorial/factory.rst","line":115,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 74: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":74,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 126: :meth:`app.test_cli_runner() ` creates a runner","file":"docs/tutorial/tests.rst","line":126,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 150: from flaskr import create_app","file":"docs/tutorial/tests.rst","line":150,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/make_celery.py\nLine 3: flask_app = create_app()","file":"examples/celery/make_celery.py","line":3,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/celery/src/task_app/__init__.py\nLine 7: def create_app() -> Flask:","file":"examples/celery/src/task_app/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 7: \"\"\"Create and configure an instance of the Flask application.\"\"\"","file":"examples/tutorial/flaskr/__init__.py","line":7,"lexical":0.55,"target":false},{"text":"File: examples/tutorial/tests/conftest.py\nLine 6: from flaskr import create_app","file":"examples/tutorial/tests/conftest.py","line":6,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/tests/test_factory.py\nLine 1: from flaskr import create_app","file":"examples/tutorial/tests/test_factory.py","line":1,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/cli.py\nLine 308: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":308,"lexical":0.55,"target":false},{"text":"File: src/flask/cli.py\nLine 566: create_app: t.Callable[..., Flask] | None = None,","file":"src/flask/cli.py","line":566,"lexical":0.55,"target":false},{"text":"File: src/flask/ctx.py\nLine 267: Do not use this class directly. Use :meth:`.Flask.app_context` to create an","file":"src/flask/ctx.py","line":267,"lexical":0.55,"target":false},{"text":"File: tests/test_cli.py\nLine 265: return Flask(\"createapp\")","file":"tests/test_cli.py","line":265,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_cli.py\nLine 301: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":301,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 312: obj = ScriptInfo(create_app=lambda: Flask(\"testapp\"))","file":"tests/test_cli.py","line":312,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 336: obj = ScriptInfo(create_app=lambda: Flask(\"testappgroup\"))","file":"tests/test_cli.py","line":336,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 351: @click.group(cls=FlaskGroup, create_app=create_app)","file":"tests/test_cli.py","line":351,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 371: @click.group(cls=FlaskGroup, create_app=create_app, set_debug_flag=set_debug_flag)","file":"tests/test_cli.py","line":371,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 386: flask_group = FlaskGroup(name=\"flask\", create_app=lambda: app)","file":"tests/test_cli.py","line":386,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 431: cli = FlaskGroup(create_app=create_app)","file":"tests/test_cli.py","line":431,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 459: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":459,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_cli.py\nLine 497: cli = FlaskGroup(create_app=lambda: app)","file":"tests/test_cli.py","line":497,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"parse_date で何をしているか教えて","query":"parse date","file":"src/flask/json/tag.py","symbol":"to_python","line":215,"lang":"ja","candidates":[{"text":"File: src/flask/json/tag.py\nLine 54: from werkzeug.http import parse_date","file":"src/flask/json/tag.py","line":54,"lexical":0.39999999999999997,"target":true},{"text":"File: src/flask/json/tag.py\nLine 216: return parse_date(value)","file":"src/flask/json/tag.py","line":216,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 19: from werkzeug.http import parse_date","file":"tests/test_basic.py","line":19,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_basic.py\nLine 440: expires = parse_date(match.group())","file":"tests/test_basic.py","line":440,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"Où est définie la fonction qui ajoute une exception à la liste de nettoyage dans les tests ?","query":"cleanup exception append","file":"tests/test_appctx.py","symbol":"cleanup","line":63,"lang":"fr","candidates":[{"text":"File: tests/test_appctx.py\nLine 51: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":51,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_appctx.py\nLine 64: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":64,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 82: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":82,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 99: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":99,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_appctx.py\nLine 122: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":122,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"busca la función que genera el diccionario para la consola interactiva","query":"shell context processor","file":"src/flask/app.py","symbol":"make_shell_context","line":621,"lang":"es","candidates":[{"text":"File: docs/cli.rst\nLine 146: Use :meth:`~Flask.shell_context_processor` to add other automatic imports.","file":"docs/cli.rst","line":146,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 65: T_shell_context_processor = t.TypeVar(","file":"src/flask/app.py","line":65,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/app.py\nLine 66: \"T_shell_context_processor\", bound=ft.ShellContextProcessorCallable","file":"src/flask/app.py","line":66,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 629: for processor in self.shell_context_processors:","file":"src/flask/app.py","line":629,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 43: T_shell_context_processor = t.TypeVar(","file":"src/flask/sansio/app.py","line":43,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 44: \"T_shell_context_processor\", bound=ft.ShellContextProcessorCallable","file":"src/flask/sansio/app.py","line":44,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 362: #: A list of shell context processor functions that should be run","file":"src/flask/sansio/app.py","line":362,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 366: self.shell_context_processors: list[ft.ShellContextProcessorCallable] = []","file":"src/flask/sansio/app.py","line":366,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 858: def shell_context_processor(","file":"src/flask/sansio/app.py","line":858,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 859: self, f: T_shell_context_processor","file":"src/flask/sansio/app.py","line":859,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 860: ) -> T_shell_context_processor:","file":"src/flask/sansio/app.py","line":860,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 861: \"\"\"Registers a shell context processor function.","file":"src/flask/sansio/app.py","line":861,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 865: self.shell_context_processors.append(f)","file":"src/flask/sansio/app.py","line":865,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/typing.py\nLine 59: ShellContextProcessorCallable = t.Callable[[], dict[str, t.Any]]","file":"src/flask/typing.py","line":59,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"데이터베이스 초기화 명령 실행 시 함수가 호출되는지 확인하는 테스트 찾아줘","query":"test init db","file":"examples/tutorial/tests/test_db.py","symbol":"test_init_db_command","line":19,"lang":"ko","candidates":[{"text":"File: docs/tutorial/tests.rst\nLine 199: def test_init_db_command(runner, monkeypatch):","file":"docs/tutorial/tests.rst","line":199,"lexical":0.65,"target":false},{"text":"File: examples/tutorial/tests/test_db.py\nLine 19: def test_init_db_command(runner, monkeypatch):","file":"examples/tutorial/tests/test_db.py","line":19,"lexical":0.65,"target":true}]} {"site":"project_search","repo":"flask","task":"Estoy intentando optimizar el envío de respuestas grandes para no cargar todo en memoria. ¿Dónde tengo la función que permite renderizar plantillas devolviendo un iterador en lugar de un string completo?","query":"stream template iterator","file":"src/flask/templating.py","symbol":"stream_template","line":181,"lang":"es","candidates":[{"text":"File: src/flask/templating.py\nLine 200: def stream_template_string(source: str, **context: t.Any) -> t.Iterator[str]:","file":"src/flask/templating.py","line":200,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/type_check/typing_route.py\nLine 92: def return_template_stream() -> t.Iterator[str]:","file":"tests/type_check/typing_route.py","line":92,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"gib den aktuellen endpunkt der flask anfrage zurück","query":"flask request endpoint","file":"tests/test_blueprints.py","symbol":"foo","line":287,"lang":"de","candidates":[{"text":"File: tests/test_basic.py\nLine 1747: return flask.request.endpoint","file":"tests/test_basic.py","line":1747,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1751: return flask.request.endpoint","file":"tests/test_basic.py","line":1751,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1755: return flask.request.endpoint","file":"tests/test_basic.py","line":1755,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 288: return flask.request.endpoint","file":"tests/test_blueprints.py","line":288,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 292: return flask.request.endpoint","file":"tests/test_blueprints.py","line":292,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 296: return flask.request.endpoint","file":"tests/test_blueprints.py","line":296,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 300: return flask.request.endpoint","file":"tests/test_blueprints.py","line":300,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 306: return flask.request.endpoint","file":"tests/test_blueprints.py","line":306,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 342: return flask.request.endpoint","file":"tests/test_blueprints.py","line":342,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1092: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1092,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 1104: return flask.request.endpoint","file":"tests/test_blueprints.py","line":1104,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Comment est gérée la distribution des fichiers statiques via un blueprint ?","query":"blueprint static file","file":"src/flask/blueprints.py","symbol":"send_static_file","line":82,"lang":"fr","candidates":[{"text":"File: docs/blueprints.rst\nLine 194: A blueprint can expose a folder with static files by providing the path","file":"docs/blueprints.rst","line":194,"lexical":0.65,"target":false},{"text":"File: docs/blueprints.rst\nLine 227: For static files, the path can be absolute or relative to the blueprint","file":"docs/blueprints.rst","line":227,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 142: the blueprint's root path. Blueprint static files are disabled","file":"src/flask/sansio/blueprints.py","line":142,"lexical":0.65,"target":false},{"text":"File: src/flask/sansio/blueprints.py\nLine 147: and the blueprint's static files won't be accessible.","file":"src/flask/sansio/blueprints.py","line":147,"lexical":0.65,"target":false},{"text":"File: tests/test_blueprints.py\nLine 231: with app.test_request_context(), blueprint.send_static_file(\"index.html\") as rv:","file":"tests/test_blueprints.py","line":231,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"busca la sección de patrones para la creación de instancias y extensiones","query":"app factories","file":"docs/patterns/appfactories.rst","symbol":"Factories & Extensions","line":55,"lang":"es","candidates":[{"text":"File: docs/appcontext.rst\nLine 26: :doc:`app factory pattern ` or writing reusable","file":"docs/appcontext.rst","line":26,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/design.rst\nLine 78: things (:doc:`/patterns/appfactories`).","file":"docs/design.rst","line":78,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 306: When using :doc:`/patterns/appfactories`:","file":"docs/errorhandling.rst","line":306,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/errorhandling.rst\nLine 360: When using :doc:`/patterns/appfactories`:","file":"docs/errorhandling.rst","line":360,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/patterns/appdispatch.rst\nLine 68: :doc:`appfactories` pattern.","file":"docs/patterns/appdispatch.rst","line":68,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/appfactories.rst\nLine 1: Application Factories","file":"docs/patterns/appfactories.rst","line":1,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/patterns/appfactories.rst\nLine 58: It's preferable to create your extensions and app factories so that the","file":"docs/patterns/appfactories.rst","line":58,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/patterns/index.rst\nLine 19: appfactories","file":"docs/patterns/index.rst","line":19,"lexical":0.39999999999999997,"target":false},{"text":"File: docs/testing.rst\nLine 45: :doc:`application factory `, define an ``app``","file":"docs/testing.rst","line":45,"lexical":0.39999999999999997,"target":false}]} {"site":"project_search","repo":"flask","task":"권한 부족 오류가 발생했을 때 특정 메시지로 변환되는 로직이 제대로 작동하는지 검증하는 테스트 코드가 누락되었습니다.","query":"forbidden error handler","file":"tests/test_user_error_handler.py","symbol":"code_exception_handler","line":108,"lang":"ko","candidates":[{"text":"File: tests/test_basic.py\nLine 900: @app.errorhandler(Forbidden)","file":"tests/test_basic.py","line":900,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 993: @app.errorhandler(ForbiddenSubclass)","file":"tests/test_basic.py","line":993,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 112: @app.errorhandler(ForbiddenSubclassRegistered)","file":"tests/test_user_error_handler.py","line":112,"lexical":0.65,"target":true},{"text":"File: tests/test_user_error_handler.py\nLine 172: @bp.errorhandler(Forbidden)","file":"tests/test_user_error_handler.py","line":172,"lexical":0.65,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 193: @app.errorhandler(Forbidden)","file":"tests/test_user_error_handler.py","line":193,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"A rota de visualização principal está retornando apenas uma string estática de boas-vindas em vez de renderizar um template ou processar lógica dinâmica.","query":"return \"Hello World!\"","file":"tests/test_views.py","symbol":"Index","line":125,"lang":"pt","candidates":[{"text":"File: README.md\nLine 30: return \"Hello, World!\"","file":"README.md","line":30,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/lifecycle.rst\nLine 29: return \"Hello, World!\"","file":"docs/lifecycle.rst","line":29,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/tutorial/tests.rst\nLine 163: the beginning of the tutorial. It returns \"Hello, World!\", so the test","file":"docs/tutorial/tests.rst","line":163,"lexical":0.44999999999999996,"target":false},{"text":"File: examples/tutorial/flaskr/__init__.py\nLine 28: return \"Hello, World!\"","file":"examples/tutorial/flaskr/__init__.py","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/ctx.py\nLine 135: return \"Hello, World!\"","file":"src/flask/ctx.py","line":135,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 353: return \"Hello, World!\"","file":"src/flask/sansio/scaffold.py","line":353,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_apps/helloworld/hello.py\nLine 8: return \"Hello World!\"","file":"tests/test_apps/helloworld/hello.py","line":8,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 81: return \"Hello World!\"","file":"tests/test_basic.py","line":81,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 98: return \"Hello World!\"","file":"tests/test_basic.py","line":98,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 113: return \"Hello World!\"","file":"tests/test_basic.py","line":113,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1701: return \"Hello World!\"","file":"tests/test_basic.py","line":1701,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_reqctx.py\nLine 168: return \"Hello World!\"","file":"tests/test_reqctx.py","line":168,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_session_interface.py\nLine 25: return \"Hello, World!\"","file":"tests/test_session_interface.py","line":25,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_templating.py\nLine 410: return DictLoader({\"index.html\": \"Hello Custom World!\"})","file":"tests/test_templating.py","line":410,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_testing.py\nLine 220: return \"Hello World!\"","file":"tests/test_testing.py","line":220,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_views.py\nLine 110: return \"Hello World!\"","file":"tests/test_views.py","line":110,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_views.py\nLine 129: return \"Hello World!\"","file":"tests/test_views.py","line":129,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 28: return jsonify(\"Hello, World!\")","file":"tests/type_check/typing_route.py","line":28,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 33: return {\"response\": \"Hello, World!\"}","file":"tests/type_check/typing_route.py","line":33,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/type_check/typing_route.py\nLine 82: return \"Hello, World!\", {\"Content-Type\": \"text/plain\"}","file":"tests/type_check/typing_route.py","line":82,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"Se está extrayendo el código de idioma de los valores de la petición y asignándolo directamente al objeto global de Flask, lo que podría causar efectos secundarios en otras partes de la aplicación durante las pruebas.","query":"flask lang code","file":"tests/test_blueprints.py","symbol":"pull_lang_code","line":158,"lang":"es","candidates":[{"text":"File: tests/test_basic.py\nLine 1648: if flask.g.lang_code is not None and app.url_map.is_endpoint_expecting(","file":"tests/test_basic.py","line":1648,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1651: values.setdefault(\"lang_code\", flask.g.lang_code)","file":"tests/test_basic.py","line":1651,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1655: flask.g.lang_code = values.pop(\"lang_code\", None)","file":"tests/test_basic.py","line":1655,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_basic.py\nLine 1667: return flask.url_for(\"about\", lang_code=\"en\")","file":"tests/test_basic.py","line":1667,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 151: bp = flask.Blueprint(\"frontend\", __name__, url_prefix=\"/\")","file":"tests/test_blueprints.py","line":151,"lexical":0.44999999999999996,"target":true},{"text":"File: tests/test_blueprints.py\nLine 155: values.setdefault(\"lang_code\", flask.g.lang_code)","file":"tests/test_blueprints.py","line":155,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 159: flask.g.lang_code = values.pop(\"lang_code\")","file":"tests/test_blueprints.py","line":159,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 841: values.setdefault(\"lang_code\", flask.g.lang_code)","file":"tests/test_blueprints.py","line":841,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 845: flask.g.lang_code = values.pop(\"lang_code\")","file":"tests/test_blueprints.py","line":845,"lexical":0.44999999999999996,"target":false}]} {"site":"project_search","repo":"flask","task":"obtener el resultado asíncrono por id incluyendo estado y valor","query":"celery async result","file":"examples/celery/src/task_app/views.py","symbol":"result","line":11,"lang":"es","candidates":[{"text":"File: docs/patterns/celery.rst\nLine 201: from celery.result import AsyncResult","file":"docs/patterns/celery.rst","line":201,"lexical":0.65,"target":false},{"text":"File: examples/celery/src/task_app/views.py\nLine 1: from celery.result import AsyncResult","file":"examples/celery/src/task_app/views.py","line":1,"lexical":0.55,"target":true}]} {"site":"project_search","repo":"flask","task":"特定のステータスコードや例外に対して、関数をエラーハンドラとして登録するためのデコレータが、登録後に元の関数をそのまま返しているため、チェインや他の装飾ができず、期待した挙動にならないことがあります。","query":"register error handler","file":"src/flask/sansio/scaffold.py","symbol":"decorator","line":643,"lang":"ja","candidates":[{"text":"File: CHANGES.rst\nLine 340: - Refactor ``register_error_handler`` to consolidate error checking.","file":"CHANGES.rst","line":340,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 814: - A catch-all error handler registered for ``HTTPException`` will not","file":"CHANGES.rst","line":814,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 910: - Error handling will try handlers registered for ``blueprint, code``,","file":"CHANGES.rst","line":910,"lexical":0.44999999999999996,"target":false},{"text":"File: CHANGES.rst\nLine 1599: - Added the ability to register application wide error handlers from","file":"CHANGES.rst","line":1599,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/api.rst\nLine 401: have error handlers registered, unless the exception was raised from","file":"docs/api.rst","line":401,"lexical":0.44999999999999996,"target":false},{"text":"File: docs/errorhandling.rst\nLine 85: This can be done by registering error handlers.","file":"docs/errorhandling.rst","line":85,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 102: :meth:`~flask.Flask.register_error_handler` to register the function later.","file":"docs/errorhandling.rst","line":102,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 112: app.register_error_handler(400, handle_bad_request)","file":"docs/errorhandling.rst","line":112,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 129: app.register_error_handler(InsufficientStorage, handle_507)","file":"docs/errorhandling.rst","line":129,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 156: This can be done by registering error handlers.","file":"docs/errorhandling.rst","line":156,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 159: If no handler is registered for the code, Flask looks up the error by its class hierarchy; the most specific handler is chosen.","file":"docs/errorhandling.rst","line":159,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 165: and a handler is registered for :exc:`ConnectionError` and","file":"docs/errorhandling.rst","line":165,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 179: It is possible to register error handlers for very generic base classes","file":"docs/errorhandling.rst","line":179,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 240: When there is no error handler registered for an exception, a 500","file":"docs/errorhandling.rst","line":240,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 245: If there is an error handler registered for ``InternalServerError``,","file":"docs/errorhandling.rst","line":245,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 317: app.register_error_handler(404, page_not_found)","file":"docs/errorhandling.rst","line":317,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 371: app.register_error_handler(500, internal_server_error)","file":"docs/errorhandling.rst","line":371,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 387: # or with register_error_handler","file":"docs/errorhandling.rst","line":387,"lexical":0.65,"target":false},{"text":"File: docs/errorhandling.rst\nLine 388: blog.register_error_handler(500, internal_server_error)","file":"docs/errorhandling.rst","line":388,"lexical":0.65,"target":false},{"text":"File: src/flask/app.py\nLine 837: registered error handlers and fall back to returning the","file":"src/flask/app.py","line":837,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/app.py\nLine 912: If an error handler is registered for ``InternalServerError`` or","file":"src/flask/app.py","line":912,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 843: :meth:`errorhandler` is registered, it will handle the exception","file":"src/flask/sansio/app.py","line":843,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/app.py\nLine 871: \"\"\"Return a registered error handler for an exception in this order:","file":"src/flask/sansio/app.py","line":871,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 110: #: A data structure of registered error handlers, in the format","file":"src/flask/sansio/scaffold.py","line":110,"lexical":0.44999999999999996,"target":true},{"text":"File: src/flask/sansio/scaffold.py\nLine 118: #: To register an error handler, use the :meth:`errorhandler`","file":"src/flask/sansio/scaffold.py","line":118,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 532: :meth:`errorhandler` is registered, it will handle the exception","file":"src/flask/sansio/scaffold.py","line":532,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 630: Use :meth:`register_error_handler` instead of modifying","file":"src/flask/sansio/scaffold.py","line":630,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 644: self.register_error_handler(code_or_exception, f)","file":"src/flask/sansio/scaffold.py","line":644,"lexical":0.44999999999999996,"target":false},{"text":"File: src/flask/sansio/scaffold.py\nLine 650: def register_error_handler(","file":"src/flask/sansio/scaffold.py","line":650,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_blueprints.py\nLine 63: blue.register_error_handler(MyFunctionException, my_function_exception_handler)","file":"tests/test_blueprints.py","line":63,"lexical":0.44999999999999996,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 20: app.register_error_handler(CustomException(), None)","file":"tests/test_user_error_handler.py","line":20,"lexical":0.65,"target":false},{"text":"File: tests/test_user_error_handler.py\nLine 25: app.register_error_handler(list, None)","file":"tests/test_user_error_handler.py","line":25,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"How do I trigger a notification to another part of the system?","query":"send signals","file":"docs/signals.rst","symbol":"Sending Signals","line":118,"lang":"en","candidates":[{"text":"File: docs/signals.rst\nLine 36: For all core Flask signals, the sender is the application that issued the","file":"docs/signals.rst","line":36,"lexical":0.6000000000000001,"target":true},{"text":"File: docs/signals.rst\nLine 116: .. _signals-sending:","file":"docs/signals.rst","line":116,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/signals.rst\nLine 118: Sending Signals","file":"docs/signals.rst","line":118,"lexical":0.6000000000000001,"target":false},{"text":"File: docs/signals.rst\nLine 149: as needed. Note the limitations described in :ref:`signals-sending` and the","file":"docs/signals.rst","line":149,"lexical":0.6000000000000001,"target":false}]} {"site":"project_search","repo":"flask","task":"prüfe ob die einstellung für sichere session cookies abgefragt wird","query":"SESSION_COOKIE_SECURE","file":"src/flask/sessions.py","symbol":"get_cookie_secure","line":202,"lang":"de","candidates":[{"text":"File: docs/config.rst\nLine 187: .. py:data:: SESSION_COOKIE_SECURE","file":"docs/config.rst","line":187,"lexical":0.35,"target":false},{"text":"File: docs/config.rst\nLine 205: Enabling this implicitly enables :data:`SESSION_COOKIE_SECURE` as well, as","file":"docs/config.rst","line":205,"lexical":0.35,"target":false},{"text":"File: docs/config.rst\nLine 413: ``SESSION_COOKIE_SECURE``","file":"docs/config.rst","line":413,"lexical":0.35,"target":false},{"text":"File: docs/web-security.rst\nLine 231: SESSION_COOKIE_SECURE=True,","file":"docs/web-security.rst","line":231,"lexical":0.35,"target":false},{"text":"File: src/flask/app.py\nLine 223: \"SESSION_COOKIE_SECURE\": False,","file":"src/flask/app.py","line":223,"lexical":0.35,"target":false},{"text":"File: src/flask/sessions.py\nLine 204: just returns the value of the ``SESSION_COOKIE_SECURE`` setting.","file":"src/flask/sessions.py","line":204,"lexical":0.35,"target":true},{"text":"File: src/flask/sessions.py\nLine 206: return app.config[\"SESSION_COOKIE_SECURE\"] # type: ignore[no-any-return]","file":"src/flask/sessions.py","line":206,"lexical":0.35,"target":false},{"text":"File: tests/test_basic.py\nLine 319: SESSION_COOKIE_SECURE=True,","file":"tests/test_basic.py","line":319,"lexical":0.35,"target":false}]} {"site":"project_search","repo":"flask","task":"vérifier que les contextes de requête sont correctement liés et isolés","query":"test context binding","file":"tests/test_reqctx.py","symbol":"test_context_binding","line":106,"lang":"fr","candidates":[{"text":"File: tests/test_reqctx.py\nLine 106: def test_context_binding(app):","file":"tests/test_reqctx.py","line":106,"lexical":0.65,"target":true},{"text":"File: tests/test_reqctx.py\nLine 134: def test_manual_context_binding(app):","file":"tests/test_reqctx.py","line":134,"lexical":0.65,"target":false},{"text":"File: tests/test_testing.py\nLine 214: def test_test_client_context_binding(app, client):","file":"tests/test_testing.py","line":214,"lexical":0.65,"target":false}]} {"site":"project_search","repo":"flask","task":"What does this function do?","query":"cleanup exception","file":"tests/test_appctx.py","symbol":"cleanup","line":50,"lang":"en","candidates":[{"text":"File: tests/test_appctx.py\nLine 50: def cleanup(exception):","file":"tests/test_appctx.py","line":50,"lexical":0.39999999999999997,"target":true},{"text":"File: tests/test_appctx.py\nLine 51: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":51,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 63: def cleanup(exception):","file":"tests/test_appctx.py","line":63,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 64: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":64,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 81: def cleanup(exception):","file":"tests/test_appctx.py","line":81,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 82: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":82,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 98: def cleanup(exception):","file":"tests/test_appctx.py","line":98,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 99: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":99,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 121: def cleanup(exception):","file":"tests/test_appctx.py","line":121,"lexical":0.39999999999999997,"target":false},{"text":"File: tests/test_appctx.py\nLine 122: cleanup_stuff.append(exception)","file":"tests/test_appctx.py","line":122,"lexical":0.39999999999999997,"target":false}]}