Results of 1 - 7 of about 7 for script (0.007 sec.)
- WebSocket 12668
- WebSocket FastAPI で WebSocket が使用できます。 WebSockets のインストール まず WebSockets のインストールが必要です。 $ pip install websockets ---> 100% WebSocket クライアント 本番環境 本番環境では、React、Vue.js、Angularなどの最新のフレーム
...も、WebSocketのエンドポイントと通信する方法があるかもしれません。 ただし、この例では非常にシンプルなHTML文書といくつかのJavaScriptを、すべてソースコードの中に入れて使用することにします。 もちろん、これは最適な方法ではありませんし、本番環境で使うことはない...(event)"> <input type="text" id="messageText" autocomplete="off"/> <button>Send</button> </form> <ul id='messages'> </ul> <script> var ws = new WebSocket("ws://localhost:8000/ws"); ws.onmessage = function(event) { var messages = document.getElementById...ent) { var input = document.getElementById("messageText") ws.send(input.value) input.value = '' event.preventDefault() } </script> </body> </html> """ @app . get ( "/" ) async def get (): return HTMLResponse ( html ) @app . websocket ( "/ws" ) async de... - https://man.mtool.work/fastapi/0.115/advanced/websockets/
- Configure Swagger UI 10523
- Configure Swagger UI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can configure some extra Swagger UI parameters . To configure them, pass the swagger_ui_pa
...configurations passed to Swagger UI directly. FastAPI converts the configurations to JSON to make them compatible with JavaScript, as that's what Swagger UI needs. Disable Syntax Highlighting For example, you could disable syntax highlighting in Swagge...shown in the browser tab. """ ), ], swagger_js_url : Annotated [ str , Doc ( """ The URL to use to load the Swagger UI JavaScript. It is normally set to a CDN URL. """ ), ] = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js" , swagg...nly call this function yourself if you needed to override some parts, for example the URLs to use to load Swagger UI's JavaScript and CSS. Read more about it in the [FastAPI docs for Configure Swagger UI](https://fastapi.tiangolo.com/how-to/configure-s... - https://man.mtool.work/fastapi/0.115/how-to/configure-swagger-ui/
- Development - Contributing 9342
- Development - Contributing Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . First, you might want to see the basic ways to help FastAPI and get help . Developing If
...the local version of FastAPI is marked to be installed in "editable" mode, with the -e option. Format the code There is a script that you can run that will format and clean all your code: $ bash scripts/format.sh It will also auto-sort all your import...s. Tests There is a script that you can run locally to test all the code and generate coverage reports in HTML: $ bash scripts/test-cov-html.sh This...our environment as described above, that will install all the requirements. Docs live During local development, there is a script that builds the site and checks for any changes, live-reloading: $ python ./scripts/docs.py live <span style="color: green... - https://man.mtool.work/fastapi/0.115/contributing/
- Release Notes 8542
- 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
...t . ? Fix issue with Swagger theme change example in the official tutorial. PR #13289 by @Zerohertz . ? Add more precise description of HTTP status code range in docs. PR #13347 by @DanielYang59 . ? Remove manual type annotations in JWT tutorial to avo...slations.py empty env var handling for PR label events vs workflow_dispatch. PR #13272 by @tiangolo . ♻️ Refactor and move scripts/notify_translations.py , no need for a custom GitHub Action. PR #13270 by @tiangolo . ? Update FastAPI People Experts scr...sponsor graphic. PR #13147 by @chailandau . ? Update FastAPI GitHub topic repositories. PR #13146 by @tiangolo . ?♀️ Add script for GitHub Topic Repositories and update External Links. PR #13135 by @alejsdev . ? Update FastAPI People - Contributors a... - https://man.mtool.work/fastapi/0.115/release-notes/
- Generate Clients 7815
- Generate Clients Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . As FastAPI is based on the OpenAPI specification, you get automatic compatibility with many tools,
...lab There are also several other companies offering similar services that you can search and find online. ? Generate a TypeScript Frontend Client Let's start with a simple FastAPI application: Python 3.9+ from fastapi import FastAPI from pydantic impor...e information from the models that is included in OpenAPI is what can be used to generate the client code . Generate a TypeScript Client Now that we have the app with the models, we can generate the client code for the frontend. Install openapi-ts You...you would put it on your package.json file. It could look like this: { "name" : "frontend-app" , "version" : "1.0.0" , "description" : "" , "main" : "index.js" , "scripts" : { "generate-client" : "openapi-ts --input http://localhost:8000/openapi.json... - https://man.mtool.work/fastapi/0.115/advanced/generate-clients/
- Virtual Environments 7452
- Virtual Environments Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . When you work in Python projects you probably should use a virtual environment (or a similar m
...with Python. $ python -m venv .venv What that command means python : use the program called python -m : call a module as a script, we'll tell it which module next venv : use the module called venv that normally comes installed with Python .venv : creat...terminal session to work on the project. Linux, macOS Windows PowerShell Windows Bash $ source .venv/bin/activate $ .venv \S cripts \A ctivate.ps1 Or if you use Bash for Windows (e.g. Git Bash ): $ source .venv/Scripts/activate Tip Every time you insta...r project (in this case awesome-project ), then it worked. ? $ Get-Command python C:\Users\user\code\awesome-project\.venv\Scripts\python If it shows the python binary at .venv\Scripts\python , inside of your project (in this case awesome-project ), th... - https://man.mtool.work/fastapi/0.115/virtual-environments/
- SQL (Relational) Databases 7197
- SQL (Relational) Databases Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . FastAPI doesn't require you to use a SQL (relational) database. But you can use any data
..."ok" : True } Here we create the tables on an application startup event. For production you would probably use a migration script that runs before you start your app. ? Tip SQLModel will have migration utilities wrapping Alembic, but for now, you can u... - https://man.mtool.work/fastapi/0.115/tutorial/sql-databases/
PREV
1
NEXT