コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 8 of about 8 for module (0.002 sec.)
Bigger Applications - Multiple Files 13664
Bigger Applications - Multiple Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you are building an application or a web API, it's rarely the case that you ... ctory contains everything. And it has an empty file app/__init__.py , so it is a "Python package" (a collection of "Python modules"): app . It contains an app/main.py file. As it is inside a Python package (a directory with a file __init__.py ), it is ... a "module" of that package: app.main . There's also an app/dependencies.py file, just like app/main.py , it is a "module": app.depen ... it's a "Python subpackage": app.routers . The file app/routers/items.py is inside a package, app/routers/ , so, it's a submodule: app.routers.items . The same with app/routers/users.py , it's another submodule: app.routers.users . There's also a subdi ...
https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
Virtual Environments 9181
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 ... need to do this once per project , not every time you work. venv uv To create a virtual environment, you can use the venv module that comes 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 : create the virtual environment in ... hon main.py // Error importing sirius, it's not installed ? Traceback (most recent call last): File "main.py", line 1, in <module> import sirius But if you deactivate the virtual environment and activate the new one for prisoner-of-askaban then when yo ...
https://man.mtool.work/fastapi/0.115/virtual-environments/
FastAPI CLI 8711
FastAPI CLI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . FastAPI CLI is a command line program that you can use to serve your FastAPI app, manage your FastAPI p ... ome/user/code/</font><font color="#AD7FA8">awesomeapp</font> <span style="background-color:#007166"><font color="#D3D7CF"> module </font></span> ? main.py <span style="background-color:#007166"><font color="#D3D7CF"> code </font></span> Importing the F ... astAPI app object from the module with the following code: <u style="text-decoration-style:solid">from </u><u style="text-decoration-style:solid"><b>main</b ...
https://man.mtool.work/fastapi/0.115/fastapi-cli/
Status Codes 8711
Status Codes You can import the status module from fastapi : from fastapi import status status is provided directly by Starlette. It contains a group of named constants (variables) with integer status codes. For example: 200: status.HTTP_20 ...
https://man.mtool.work/fastapi/0.115/reference/status/
Settings and Environment Variables 8151
Settings and Environment Variables Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In many cases your application could need some external settings or configuratio ... . The app_name would be "ChimichangApp" . And the items_per_user would keep its default value of 50 . Settings in another module You could put those settings in another module file as you saw in Bigger Applications - Multiple Files . For example, you ...
https://man.mtool.work/fastapi/0.115/advanced/settings/
Lifespan Events 7988
Lifespan Events Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define logic (code) that should be executed before the application starts up . This means t ... to read a lot of data from disk . So you don't want to do it for every request. You could load it at the top level of the module/file, but that would also mean that it would load the model even if you are just running a simple automated test, then tha ...
https://man.mtool.work/fastapi/0.115/advanced/events/
HTTP Basic Auth 7916
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 ... re complete example. Use a dependency to check if the username and password are correct. For this, use the Python standard module secrets to check the username and password. secrets.compare_digest() needs to take bytes or a str that only contains ASCII ...
https://man.mtool.work/fastapi/0.115/advanced/security/http-basic-auth/
最初のステップ 7916
最初のステップ 最もシンプルなFastAPIファイルは以下のようになります: Python 3.8+ from fastapi import FastAPI app = FastAPI () @app . get ( "/" ) async def root (): return { "message" : "Hello World" } これを main.py にコピーします。 ライブサ ... reen;">INFO</span>: Application startup complete. 備考 uvicorn main:app は以下を示します: main : main.py ファイル (Python "module")。 app : main.py 内部で作られるobject( app = FastAPI() のように記述される)。 --reload : コードの変更時にサーバーを再起動 ...
https://man.mtool.work/fastapi/0.115/tutorial/first-steps/
PREV 1 NEXT