]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commit
:sparkles: Re-export utils from Starlette (#1064)
authorSebastián Ramírez <tiangolo@gmail.com>
Sun, 1 Mar 2020 20:49:20 +0000 (21:49 +0100)
committerGitHub <noreply@github.com>
Sun, 1 Mar 2020 20:49:20 +0000 (21:49 +0100)
commit0ac9b3ee5ce85b9ebc23698f8515e07017d9b9aa
tree413a09c8c643a7dc57920fdfba164a63fd961b3a
parentf2bd2c44e2e568576ad92f49b82c99bf686dc658
:sparkles: Re-export utils from Starlette (#1064)

* :sparkles: Re-export main features used from Starlette to simplify developer's code

* :recycle: Refactor Starlette exports

* :recycle: Refactor tutorial examples to use re-exported utils from Starlette

* :memo: Add examples for all middlewares

* :memo: Add new docs for middlewares

* :memo: Add examples for custom responses

* :memo: Extend docs for custom responses

* :memo: Update docs and add notes explaining re-exports from Starlette everywhere

* :bento: Update screenshot for HTTP status

* :wrench: Update MkDocs config with new content

* :recycle: Refactor tests to use re-exported utils from Starlette

* :sparkles: Re-export WebSocketDisconnect from Starlette for tests

* :white_check_mark: Add extra tests for extra re-exported middleware

* :white_check_mark: Add tests for re-exported responses from Starlette

* :sparkles: Add docs about mounting WSGI apps

* :heavy_plus_sign: Add Flask as a dependency to test WSGIMiddleware

* :white_check_mark: Test WSGIMiddleware example
267 files changed:
docs/advanced/additional-status-codes.md
docs/advanced/advanced-dependencies.md
docs/advanced/custom-request-and-route.md
docs/advanced/custom-response.md
docs/advanced/extending-openapi.md
docs/advanced/middleware.md [new file with mode: 0644]
docs/advanced/response-change-status-code.md
docs/advanced/response-cookies.md
docs/advanced/response-directly.md
docs/advanced/response-headers.md
docs/advanced/security/http-basic-auth.md
docs/advanced/security/oauth2-scopes.md
docs/advanced/templates.md
docs/advanced/using-request-directly.md
docs/advanced/websockets.md
docs/advanced/wsgi.md [new file with mode: 0644]
docs/img/tutorial/response-status-code/image02.png
docs/src/additional_responses/tutorial001.py
docs/src/additional_responses/tutorial002.py
docs/src/additional_responses/tutorial003.py
docs/src/additional_responses/tutorial004.py
docs/src/additional_status_codes/tutorial001.py
docs/src/advanced_middleware/tutorial001.py [new file with mode: 0644]
docs/src/advanced_middleware/tutorial002.py [new file with mode: 0644]
docs/src/advanced_middleware/tutorial003.py [new file with mode: 0644]
docs/src/app_testing/test_main.py
docs/src/app_testing/test_main_b.py
docs/src/app_testing/tutorial001.py
docs/src/app_testing/tutorial002.py
docs/src/app_testing/tutorial003.py
docs/src/cors/tutorial001.py
docs/src/custom_request_and_route/tutorial001.py
docs/src/custom_request_and_route/tutorial002.py
docs/src/custom_request_and_route/tutorial003.py
docs/src/custom_response/tutorial001.py
docs/src/custom_response/tutorial002.py
docs/src/custom_response/tutorial003.py
docs/src/custom_response/tutorial004.py
docs/src/custom_response/tutorial005.py [new file with mode: 0644]
docs/src/custom_response/tutorial006.py [new file with mode: 0644]
docs/src/custom_response/tutorial007.py [new file with mode: 0644]
docs/src/custom_response/tutorial008.py [new file with mode: 0644]
docs/src/custom_response/tutorial009.py [new file with mode: 0644]
docs/src/dependency_testing/tutorial001.py
docs/src/extending_openapi/tutorial002.py
docs/src/handling_errors/tutorial003.py
docs/src/handling_errors/tutorial004.py
docs/src/handling_errors/tutorial005.py
docs/src/middleware/tutorial001.py
docs/src/openapi_callbacks/tutorial001.py
docs/src/path_operation_configuration/tutorial001.py
docs/src/request_files/tutorial002.py
docs/src/response_change_status_code/tutorial001.py
docs/src/response_cookies/tutorial001.py
docs/src/response_cookies/tutorial002.py
docs/src/response_directly/tutorial001.py
docs/src/response_directly/tutorial002.py
docs/src/response_headers/tutorial001.py
docs/src/response_headers/tutorial002.py
docs/src/response_status_code/tutorial002.py
docs/src/security/tutorial003.py
docs/src/security/tutorial004.py
docs/src/security/tutorial005.py
docs/src/security/tutorial007.py
docs/src/sql_databases/sql_app/alt_main.py
docs/src/static_files/tutorial001.py
docs/src/templates/tutorial001.py
docs/src/using_request_directly/tutorial001.py
docs/src/websockets/tutorial001.py
docs/src/websockets/tutorial002.py
docs/src/wsgi/tutorial001.py [new file with mode: 0644]
docs/tutorial/cors.md
docs/tutorial/handling-errors.md
docs/tutorial/middleware.md
docs/tutorial/path-operation-configuration.md
docs/tutorial/request-files.md
docs/tutorial/response-status-code.md
docs/tutorial/security/oauth2-jwt.md
docs/tutorial/security/simple-oauth2.md
docs/tutorial/sql-databases.md
docs/tutorial/static-files.md
docs/tutorial/testing.md
fastapi/__init__.py
fastapi/background.py [new file with mode: 0644]
fastapi/concurrency.py
fastapi/middleware/__init__.py [new file with mode: 0644]
fastapi/middleware/cors.py [new file with mode: 0644]
fastapi/middleware/gzip.py [new file with mode: 0644]
fastapi/middleware/httpsredirect.py [new file with mode: 0644]
fastapi/middleware/trustedhost.py [new file with mode: 0644]
fastapi/middleware/wsgi.py [new file with mode: 0644]
fastapi/requests.py [new file with mode: 0644]
fastapi/responses.py [new file with mode: 0644]
fastapi/routing.py
fastapi/staticfiles.py [new file with mode: 0644]
fastapi/templating.py [new file with mode: 0644]
fastapi/testclient.py [new file with mode: 0644]
fastapi/websockets.py [new file with mode: 0644]
mkdocs.yml
pyproject.toml
tests/test_additional_properties.py
tests/test_additional_response_extra.py
tests/test_additional_responses_bad.py
tests/test_additional_responses_custom_validationerror.py
tests/test_additional_responses_default_validationerror.py
tests/test_additional_responses_response_class.py
tests/test_additional_responses_router.py
tests/test_application.py
tests/test_callable_endpoint.py
tests/test_custom_route_class.py
tests/test_custom_swagger_ui_redirect.py
tests/test_datetime_custom_encoder.py
tests/test_default_response_class.py
tests/test_default_response_class_router.py
tests/test_dependency_cache.py
tests/test_dependency_class.py
tests/test_dependency_contextmanager.py
tests/test_dependency_overrides.py
tests/test_empty_router.py
tests/test_extra_routes.py
tests/test_filter_pydantic_sub_model.py
tests/test_forms_from_non_typing_sequences.py
tests/test_include_route.py
tests/test_infer_param_optionality.py
tests/test_inherited_custom_class.py
tests/test_modules_same_name_body/test_main.py
tests/test_multi_body_errors.py
tests/test_multi_query_errors.py
tests/test_no_swagger_ui_redirect.py
tests/test_param_class.py
tests/test_param_in_path_and_dependency.py
tests/test_path.py
tests/test_put_no_body.py
tests/test_query.py
tests/test_repeated_dependency_schema.py
tests/test_request_body_parameters_media_type.py
tests/test_response_change_status_code.py
tests/test_response_class_no_mediatype.py
tests/test_response_code_no_body.py
tests/test_response_model_sub_types.py
tests/test_router_events.py
tests/test_router_prefix_with_template.py
tests/test_security_api_key_cookie.py
tests/test_security_api_key_cookie_optional.py
tests/test_security_api_key_header.py
tests/test_security_api_key_header_optional.py
tests/test_security_api_key_query.py
tests/test_security_api_key_query_optional.py
tests/test_security_http_base.py
tests/test_security_http_base_optional.py
tests/test_security_http_basic_optional.py
tests/test_security_http_basic_realm.py
tests/test_security_http_bearer.py
tests/test_security_http_bearer_optional.py
tests/test_security_http_digest.py
tests/test_security_http_digest_optional.py
tests/test_security_oauth2.py
tests/test_security_oauth2_authorization_code_bearer.py
tests/test_security_oauth2_optional.py
tests/test_security_oauth2_password_bearer_optional.py
tests/test_security_openid_connect.py
tests/test_security_openid_connect_optional.py
tests/test_serialize_response.py
tests/test_serialize_response_dataclass.py
tests/test_skip_defaults.py
tests/test_starlette_exception.py
tests/test_starlette_urlconvertors.py
tests/test_sub_callbacks.py
tests/test_swagger_ui_init_oauth.py
tests/test_tutorial/test_additional_responses/test_tutorial001.py
tests/test_tutorial/test_additional_responses/test_tutorial002.py
tests/test_tutorial/test_additional_responses/test_tutorial003.py
tests/test_tutorial/test_additional_responses/test_tutorial004.py
tests/test_tutorial/test_additional_status_codes/test_tutorial001.py
tests/test_tutorial/test_advanced_middleware/__init__.py [new file with mode: 0644]
tests/test_tutorial/test_advanced_middleware/test_tutorial001.py [new file with mode: 0644]
tests/test_tutorial/test_advanced_middleware/test_tutorial002.py [new file with mode: 0644]
tests/test_tutorial/test_advanced_middleware/test_tutorial003.py [new file with mode: 0644]
tests/test_tutorial/test_application_configuration/test_tutorial001.py
tests/test_tutorial/test_async_sql_databases/test_tutorial001.py
tests/test_tutorial/test_background_tasks/test_tutorial001.py
tests/test_tutorial/test_background_tasks/test_tutorial002.py
tests/test_tutorial/test_bigger_applications/test_main.py
tests/test_tutorial/test_body/test_tutorial001.py
tests/test_tutorial/test_body_fields/test_tutorial001.py
tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
tests/test_tutorial/test_body_nested_models/test_tutorial009.py
tests/test_tutorial/test_body_updates/test_tutorial001.py
tests/test_tutorial/test_cookie_params/test_tutorial001.py
tests/test_tutorial/test_cors/__init__.py [new file with mode: 0644]
tests/test_tutorial/test_cors/test_tutorial001.py [new file with mode: 0644]
tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py
tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
tests/test_tutorial/test_custom_request_and_route/test_tutorial003.py
tests/test_tutorial/test_custom_response/test_tutorial001.py
tests/test_tutorial/test_custom_response/test_tutorial004.py
tests/test_tutorial/test_custom_response/test_tutorial005.py [new file with mode: 0644]
tests/test_tutorial/test_custom_response/test_tutorial006.py [new file with mode: 0644]
tests/test_tutorial/test_custom_response/test_tutorial007.py [new file with mode: 0644]
tests/test_tutorial/test_custom_response/test_tutorial008.py [new file with mode: 0644]
tests/test_tutorial/test_dependencies/test_tutorial001.py
tests/test_tutorial/test_dependencies/test_tutorial004.py
tests/test_tutorial/test_dependencies/test_tutorial006.py
tests/test_tutorial/test_events/test_tutorial001.py
tests/test_tutorial/test_events/test_tutorial002.py
tests/test_tutorial/test_extending_openapi/test_tutorial001.py
tests/test_tutorial/test_extending_openapi/test_tutorial002.py
tests/test_tutorial/test_extra_data_types/test_tutorial001.py
tests/test_tutorial/test_extra_models/test_tutorial003.py
tests/test_tutorial/test_extra_models/test_tutorial004.py
tests/test_tutorial/test_extra_models/test_tutorial005.py
tests/test_tutorial/test_first_steps/test_tutorial001.py
tests/test_tutorial/test_handling_errors/test_tutorial001.py
tests/test_tutorial/test_handling_errors/test_tutorial002.py
tests/test_tutorial/test_handling_errors/test_tutorial003.py
tests/test_tutorial/test_handling_errors/test_tutorial004.py
tests/test_tutorial/test_handling_errors/test_tutorial005.py
tests/test_tutorial/test_handling_errors/test_tutorial006.py
tests/test_tutorial/test_header_params/test_tutorial001.py
tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial003.py
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py
tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py
tests/test_tutorial/test_path_operation_configurations/test_tutorial006.py
tests/test_tutorial/test_path_params/test_tutorial004.py
tests/test_tutorial/test_path_params/test_tutorial005.py
tests/test_tutorial/test_query_params/test_tutorial005.py
tests/test_tutorial/test_query_params/test_tutorial006.py
tests/test_tutorial/test_query_params/test_tutorial007.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial001.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial011.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial012.py
tests/test_tutorial/test_query_params_str_validations/test_tutorial013.py
tests/test_tutorial/test_request_files/test_tutorial001.py
tests/test_tutorial/test_request_files/test_tutorial002.py
tests/test_tutorial/test_request_forms/test_tutorial001.py
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
tests/test_tutorial/test_response_change_status_code/test_tutorial001.py
tests/test_tutorial/test_response_cookies/test_tutorial001.py
tests/test_tutorial/test_response_cookies/test_tutorial002.py
tests/test_tutorial/test_response_headers/test_tutorial001.py
tests/test_tutorial/test_response_headers/test_tutorial002.py
tests/test_tutorial/test_response_model/test_tutorial003.py
tests/test_tutorial/test_response_model/test_tutorial004.py
tests/test_tutorial/test_response_model/test_tutorial005.py
tests/test_tutorial/test_response_model/test_tutorial006.py
tests/test_tutorial/test_security/test_tutorial001.py
tests/test_tutorial/test_security/test_tutorial003.py
tests/test_tutorial/test_security/test_tutorial005.py
tests/test_tutorial/test_security/test_tutorial006.py
tests/test_tutorial/test_sql_databases/test_sql_databases.py
tests/test_tutorial/test_sql_databases/test_sql_databases_middleware.py
tests/test_tutorial/test_sql_databases_peewee/test_sql_databases_peewee.py
tests/test_tutorial/test_sub_applications/test_tutorial001.py
tests/test_tutorial/test_templates/test_tutorial001.py
tests/test_tutorial/test_websockets/test_tutorial001.py
tests/test_tutorial/test_websockets/test_tutorial002.py
tests/test_tutorial/test_wsgi/__init__.py [new file with mode: 0644]
tests/test_tutorial/test_wsgi/test_tutorial001.py [new file with mode: 0644]
tests/test_union_body.py
tests/test_union_inherited_body.py
tests/test_validate_response.py
tests/test_validate_response_dataclass.py
tests/test_ws_router.py