Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 24 for __name__ (0.11 seconds)

  1. docs/zh-hant/docs/tutorial/debugging.md

    你可以在編輯器中連接偵錯器,例如 Visual Studio Code 或 PyCharm。
    
    ## 呼叫 `uvicorn` { #call-uvicorn }
    
    在你的 FastAPI 應用程式中,直接匯入並執行 `uvicorn`:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### 關於 `__name__ == "__main__"` { #about-name-main }
    
    `__name__ == "__main__"` 的主要目的是,當你的檔案以以下方式呼叫時,執行某些程式碼:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    但當其他檔案匯入它時不會執行,例如:
    
    ```Python
    from myapp import app
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  2. docs/zh/docs/tutorial/debugging.md

    你可以在编辑器中连接调试器,例如使用 Visual Studio Code 或 PyCharm。
    
    ## 调用 `uvicorn` { #call-uvicorn }
    
    在你的 FastAPI 应用中直接导入 `uvicorn` 并运行:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### 关于 `__name__ == "__main__"` { #about-name-main }
    
    `__name__ == "__main__"` 的主要目的是使用以下代码调用文件时执行一些代码:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    而当其它文件导入它时并不会被调用,像这样:
    
    ```Python
    from myapp import app
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  3. docs/ja/docs/tutorial/debugging.md

    ## `uvicorn` を呼び出す { #call-uvicorn }
    
    FastAPIアプリケーション上で、`uvicorn` を直接インポートして実行します:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### `__name__ == "__main__"` について { #about-name-main }
    
    `__name__ == "__main__"` の主な目的は、ファイルが次のコマンドで呼び出されたときに実行されるコードを用意することです:
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    ただし、次のように、別のファイルからインポートされるときには呼び出されません:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 3.1K bytes
    - Click Count (0)
  4. docs/ko/docs/tutorial/debugging.md

    ## `uvicorn` 호출 { #call-uvicorn }
    
    FastAPI 애플리케이션에서 `uvicorn`을 직접 임포트하여 실행합니다:
    
    {* ../../docs_src/debugging/tutorial001_py310.py hl[1,15] *}
    
    ### `__name__ == "__main__"` 에 대하여 { #about-name-main }
    
    `__name__ == "__main__"`의 주요 목적은 다음과 같이 파일이 호출될 때 실행되는 일부 코드를 갖는 것입니다.
    
    <div class="termy">
    
    ```console
    $ python myapp.py
    ```
    
    </div>
    
    그러나 다음과 같이 다른 파일을 가져올 때는 호출되지 않습니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 2.8K bytes
    - Click Count (0)
  5. fastapi/security/http.py

            description: str | None = None,
            auto_error: bool = True,
        ):
            self.model = HTTPBaseModel(scheme=scheme, description=description)
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        def make_authenticate_headers(self) -> dict[str, str]:
            return {"WWW-Authenticate": f"{self.model.scheme.title()}"}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 16 10:16:48 GMT 2026
    - 13.1K bytes
    - Click Count (0)
  6. scripts/add_latest_release_date.py

            with open(RELEASE_NOTES_FILE, "w") as f:
                f.writelines(lines)
            sys.exit(0)
    
        print("No release header found")
        sys.exit(1)
    
    
    if __name__ == "__main__":
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Apr 03 12:06:36 GMT 2026
    - 1023 bytes
    - Click Count (0)
  7. fastapi/_compat/v2.py

            ModelField(
                field_info=FieldInfo(annotation=model),
                name=model.__name__,
                mode="validation",
            )
            for model in flat_validation_models
        ]
        flat_serialization_model_fields = [
            ModelField(
                field_info=FieldInfo(annotation=model),
                name=model.__name__,
                mode="serialization",
            )
            for model in flat_serialization_models
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 16.7K bytes
    - Click Count (0)
  8. fastapi/security/open_id_connect_url.py

                ),
            ] = True,
        ):
            self.model = OpenIdConnectModel(
                openIdConnectUrl=openIdConnectUrl, description=description
            )
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        def make_not_authenticated_error(self) -> HTTPException:
            return HTTPException(
                status_code=HTTP_401_UNAUTHORIZED,
                detail="Not authenticated",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 16 10:16:48 GMT 2026
    - 3.1K bytes
    - Click Count (0)
  9. fastapi/dependencies/utils.py

                    and dependant.computed_scope == "request"
                    and param_details.depends.scope == "function"
                ):
                    assert dependant.call
                    call_name = getattr(dependant.call, "__name__", "<unnamed_callable>")
                    raise DependencyScopeError(
                        f'The dependency "{call_name}" has a scope of '
                        '"request", it cannot depend on dependencies with scope "function".'
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 38.7K bytes
    - Click Count (3)
  10. fastapi/params.py

            use_kwargs = {k: v for k, v in kwargs.items() if v is not _Unset}
    
            super().__init__(**use_kwargs)
    
        def __repr__(self) -> str:
            return f"{self.__class__.__name__}({self.default})"
    
    
    class Path(Param):  # type: ignore[misc]  # ty: ignore[unused-ignore-comment]
        in_ = ParamTypes.path
    
        def __init__(
            self,
            default: Any = ...,
            *,
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 25.7K bytes
    - Click Count (0)
Back to Top