コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 9 of about 9 for login (0.009 sec.)
Form Models 12456
Form Models Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use Pydantic models to declare form fields in FastAPI. Info To use forms, first install python- ... rom pydantic import BaseModel app = FastAPI () class FormData ( BaseModel ): username : str password : str @app . post ( "/login/" ) async def login ( data : Annotated [ FormData , Form ()]): return data ? Other versions and variants Python 3.8+ Pytho ... g_extensions import Annotated app = FastAPI () class FormData ( BaseModel ): username : str password : str @app . post ( "/login/" ) async def login ( data : Annotated [ FormData , Form ()]): return data Tip Prefer to use the Annotated version if poss ... rom pydantic import BaseModel app = FastAPI () class FormData ( BaseModel ): username : str password : str @app . post ( "/login/" ) async def login ( data : FormData = Form ()): return data FastAPI will extract the data for each field from the form d ...
https://man.mtool.work/fastapi/0.115/tutorial/request-form-models/
フォームデータ 11432
フォームデータ JSONの代わりにフィールドを受け取る場合は、 Form を使用します。 情報 フォームを使うためには、まず python-multipart をインストールします。 たとえば、 pip install python-multipart のように。 Form のインポート fastapi から Form を ... インポートします: Python 3.8+ - non-Annotated from fastapi import FastAPI , Form app = FastAPI () @app . post ( "/login/" ) async def login ( username : str = Form (), password : str = Form ()): return { "username" : username } ? Other versio ... s Python 3.9+ Python 3.8+ from typing import Annotated from fastapi import FastAPI , Form app = FastAPI () @app . post ( "/login/" ) async def login ( username : Annotated [ str , Form ()], password : Annotated [ str , Form ()]): return { "username" : ... username } from fastapi import FastAPI , Form from typing_extensions import Annotated app = FastAPI () @app . post ( "/login/" ) async def login ( username : Annotated [ str , Form ()], password : Annotated [ str , Form ()]): return { "username" : ...
https://man.mtool.work/fastapi/0.115/tutorial/request-forms/
Simple OAuth2 with Password and Bearer 9616
Simple OAuth2 with Password and Bearer Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Now let's build from the previous chapter and add the missing parts to have ... it as you wish to your final users in the frontend. And your database models can use any other names you want. But for the login path operation , we need to use these names to be compatible with the spec (and be able to, for example, use the integrate ... aise HTTPException ( status_code = 400 , detail = "Inactive user" ) return current_user @app . post ( "/token" ) async def login ( form_data : Annotated [ OAuth2PasswordRequestForm , Depends ()]): user_dict = fake_users_db . get ( form_data . username ... aise HTTPException ( status_code = 400 , detail = "Inactive user" ) return current_user @app . post ( "/token" ) async def login ( form_data : Annotated [ OAuth2PasswordRequestForm , Depends ()]): user_dict = fake_users_db . get ( form_data . username ...
https://man.mtool.work/fastapi/0.115/tutorial/security/simple-oauth2/
OAuth2 scopes 8915
OAuth2 scopes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use OAuth2 scopes directly with FastAPI , they are integrated to work seamlessly. This would ... e, GitHub, Microsoft, Twitter, etc. They use it to provide specific permissions to users and applications. Every time you "log in with" Facebook, Google, GitHub, Microsoft, Twitter, that application is using OAuth2 with scopes. In this section you wil ... aise HTTPException ( status_code = 400 , detail = "Inactive user" ) return current_user @app . post ( "/token" ) async def login_for_access_token ( form_data : Annotated [ OAuth2PasswordRequestForm , Depends ()], ) -> Token : user = authenticate_user ... aise HTTPException ( status_code = 400 , detail = "Inactive user" ) return current_user @app . post ( "/token" ) async def login_for_access_token ( form_data : Annotated [ OAuth2PasswordRequestForm , Depends ()], ) -> Token : user = authenticate_user ...
https://man.mtool.work/fastapi/0.115/advanced/security/oauth2-scopes/
パスワード(およびハッシュ化)によるOAuth2、JWTトークンによるBearer 8699
パスワード(およびハッシュ化)によるOAuth2、JWTトークンによるBearer これでセキュリティの流れが全てわかったので、 JWT トークンと安全なパスワードのハッシュ化を使用して、実際にアプリケーションを安全にしてみましょう。 このコードは、アプリケーシ ... aise HTTPException ( status_code = 400 , detail = "Inactive user" ) return current_user @app . post ( "/token" ) async def login_for_access_token ( form_data : OAuth2PasswordRequestForm = Depends (), ) -> Token : user = authenticate_user ( fake_users_ ... aise HTTPException ( status_code = 400 , detail = "Inactive user" ) return current_user @app . post ( "/token" ) async def login_for_access_token ( form_data : Annotated [ OAuth2PasswordRequestForm , Depends ()], ) -> Token : user = authenticate_user ... aise HTTPException ( status_code = 400 , detail = "Inactive user" ) return current_user @app . post ( "/token" ) async def login_for_access_token ( form_data : Annotated [ OAuth2PasswordRequestForm , Depends ()], ) -> Token : user = authenticate_user ...
https://man.mtool.work/fastapi/0.115/tutorial/security/oauth2-jwt/
メタデータとドキュメントのURL 8106
メタデータとドキュメントのURL FastAPI アプリケーションのいくつかのメタデータの設定をカスタマイズできます。 タイトル、説明文、バージョン 以下を設定できます: タイトル : OpenAPIおよび自動APIドキュメントUIでAPIのタイトル/名前として使用される。 ... thon 3.8+ from fastapi import FastAPI tags_metadata = [ { "name" : "users" , "description" : "Operations with users. The **login** logic is also here." , }, { "name" : "items" , "description" : "Manage items. So _fancy_ they have their own docs." , "e ... wand" }, { "name" : "flying broom" }] 説明文 (description) の中で Markdown を使用できることに注意してください。たとえば、「login」は太字 ( login ) で表示され、「fancy」は斜体 ( fancy ) で表示されます。 豆知識 使用するすべてのタグにメタデータを追加する必 ... thon 3.8+ from fastapi import FastAPI tags_metadata = [ { "name" : "users" , "description" : "Operations with users. The **login** logic is also here." , }, { "name" : "items" , "description" : "Manage items. So _fancy_ they have their own docs." , "e ...
https://man.mtool.work/fastapi/0.115/tutorial/metadata/
Release Notes 7261
Release Notes Latest Changes 0.115.11 Fixes ? Add docs examples and tests (support) for Annotated custom validations, like AfterValidator , revert #13440 . PR #13442 by @tiangolo . New docs: Query Parameters and String Validations - Custom ... stAPI () class FormData ( BaseModel ): username : str password : str model_config = { "extra" : "forbid" } @app . post ( "/login/" ) async def login ( data : Annotated [ FormData , Form ()]): return data Read the new docs: Form Models - Forbid Extra F ... rom pydantic import BaseModel app = FastAPI () class FormData ( BaseModel ): username : str password : str @app . post ( "/login/" ) async def login ( data : Annotated [ FormData , Form ()]): return data Read the new docs: Form Models . Features ✨ Add ... ependencies-with-yield.md . PR #10834 by @Molkree . ? Add article: "Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included". PR #9733 by @dxphilo . ? Add warning about lifecycle events with AsyncClient . PR #4167 by @andre ...
https://man.mtool.work/fastapi/0.115/release-notes/
HTTP Basic Auth 7154
HTTP Basic Auth Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . For the simplest cases, you can use HTTP Basic Auth. In HTTP Basic Auth, the application expects a ... 401 (the same returned when no credentials are provided) and add the header WWW-Authenticate to make the browser show the login prompt again: Python 3.9+ import secrets from typing import Annotated from fastapi import Depends , FastAPI , HTTPExceptio ...
https://man.mtool.work/fastapi/0.115/advanced/security/http-basic-auth/
External Links and Articles 7154
External Links and Articles FastAPI has a great community constantly growing. There are many posts, articles, tools, and projects, related to FastAPI . Here's an incomplete list of some of them. Tip If you have an article, project, tool, or ... Code Team . FastAPI application monitoring made easy by Apitally . Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included by John Philip . Building a CRUD API with FastAPI and Supabase by Keshav Malik . Build an SMS Spam ...
https://man.mtool.work/fastapi/0.115/external-links/
PREV 1 NEXT