From 534c76bdf4f79a8fe2728df5909d370f62b435ba Mon Sep 17 00:00:00 2001 From: Ruidy Date: Thu, 12 Aug 2021 13:34:56 +0200 Subject: [PATCH] docs(fr): add translation --- docs/fr/docs/deployment/deta.md | 105 +++++++++++++++++--------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/docs/fr/docs/deployment/deta.md b/docs/fr/docs/deployment/deta.md index fd4b30a3..d19f3577 100644 --- a/docs/fr/docs/deployment/deta.md +++ b/docs/fr/docs/deployment/deta.md @@ -1,19 +1,20 @@ -# Deploy FastAPI on Deta +# DĂ©ployer FastAPI sur Deta -In this section you will learn how to easily deploy a **FastAPI** application on Deta using the free plan. 🎁 +Dans cette section, vous apprendrez Ă  dĂ©ployer facilement une application **FastAPI** sur Deta en utilisant le plan tarifaire gratuit. 🎁 -It will take you about **10 minutes**. +Cela vous prendra environ **10 minutes**. !!! info - Deta is a **FastAPI** sponsor. 🎉 + Deta sponsorise **FastAPI**. 🎉 -## A basic **FastAPI** app +## Une application **FastAPI** de base -* Create a directory for your app, for example `./fastapideta/` and enter in it. +* CrĂ©ez un rĂ©pertoire pour votre application, par exemple `./fastapideta/` et dĂ©placez-vous dedans. -### FastAPI code +### Le code FastAPI -* Create a `main.py` file with: +* CrĂ©er un fichier `main.py` avec : ```Python from fastapi import FastAPI @@ -31,20 +32,20 @@ def read_item(item_id: int): return {"item_id": item_id} ``` -### Requirements +### DĂ©pendances -Now, in the same directory create a file `requirements.txt` with: +Maintenant, dans le mĂȘme rĂ©pertoire, crĂ©ez un fichier `requirements.txt` avec : ```text fastapi ``` !!! tip - You don't need to install Uvicorn to deploy on Deta, although you would probably want to install it locally to test your app. + Il n'est pas nĂ©cessaire d'installer Uvicorn pour dĂ©ployer sur Deta, bien qu'il soit probablement souhaitable de l'installer localement pour tester votre application. -### Directory structure +### Structure du rĂ©pertoire -You will now have one directory `./fastapideta/` with two files: +Vous aurez maintenant un rĂ©pertoire `./fastapideta/` avec deux fichiers : ``` . @@ -52,15 +53,16 @@ You will now have one directory `./fastapideta/` with two files: └── requirements.txt ``` -## Create a free Deta account +## CrĂ©er un compte gratuit sur Deta -Now create a free account on Deta, you just need an email and password. +CrĂ©ez maintenant un compte gratuit +sur Deta, vous avez juste besoin d'une adresse email et d'un mot de passe. -You don't even need a credit card. +Vous n'avez mĂȘme pas besoin d'une carte de crĂ©dit. -## Install the CLI +## Installer le CLI (Interface en Ligne de Commande) -Once you have your account, install the Deta CLI: +Une fois que vous avez votre compte, installez le CLI de Deta : === "Linux, macOS" @@ -82,9 +84,9 @@ Once you have your account, install the Deta @@ -107,11 +109,11 @@ Available Commands: !!! tip - If you have problems installing the CLI, check the official Deta docs. + Si vous rencontrez des problĂšmes pour installer le CLI, consultez la documentation officielle de Deta (en anglais). -## Login with the CLI +## Connexion avec le CLI -Now login to Deta from the CLI with: +Maintenant, connectez-vous Ă  Deta depuis le CLI avec :
@@ -124,11 +126,11 @@ Logged in successfully.
-This will open a web browser and authenticate automatically. +Cela ouvrira un navigateur web et permettra une authentification automatique. -## Deploy with Deta +## Déployer avec Deta -Next, deploy your application with the Deta CLI: +Ensuite, déployez votre application avec le CLI de Deta :
@@ -158,7 +160,7 @@ Successfully installed fastapi-0.61.1 pydantic-1.7.2 starlette-0.13.6
-You will see a JSON message similar to: +Vous verrez un message JSON similaire à : ```JSON hl_lines="4" { @@ -171,13 +173,14 @@ You will see a JSON message similar to: ``` !!! tip - Your deployment will have a different `"endpoint"` URL. + Votre dĂ©ploiement aura une URL `"endpoint"` diffĂ©rente. -## Check it +## VĂ©rifiez -Now open your browser in your `endpoint` URL. In the example above it was `https://qltnci.deta.dev`, but yours will be different. +Maintenant, dans votre navigateur ouvrez votre URL `endpoint`. Dans l'exemple ci-dessus, c'Ă©tait +`https://qltnci.deta.dev`, mais la vĂŽtre sera diffĂ©rente. -You will see the JSON response from your FastAPI app: +Vous verrez la rĂ©ponse JSON de votre application FastAPI : ```JSON { @@ -185,17 +188,17 @@ You will see the JSON response from your FastAPI app: } ``` -And now go to the `/docs` for your API, in the example above it would be `https://qltnci.deta.dev/docs`. +Et maintenant naviguez vers `/docs` dans votre API, dans l'exemple ci-dessus ce serait `https://qltnci.deta.dev/docs`. -It will show your docs like: +Vous verrez votre documentation comme suit : -## Enable public access +## Activer l'accĂšs public -By default, Deta will handle authentication using cookies for your account. +Par dĂ©faut, Deta va gĂ©rer l'authentification en utilisant des cookies pour votre compte. -But once you are ready, you can make it public with: +Mais une fois que vous ĂȘtes prĂȘt, vous pouvez le rendre public avec :
@@ -207,34 +210,36 @@ Successfully disabled http auth
-Now you can share that URL with anyone and they will be able to access your API. 🚀 +Maintenant, vous pouvez partager cette URL avec n'importe qui et ils seront en mesure d'accĂ©der Ă  votre API. 🚀 ## HTTPS -Congrats! You deployed your FastAPI app to Deta! 🎉 🍰 +FĂ©licitations ! Vous avez dĂ©ployĂ© votre application FastAPI sur Deta ! 🎉 🍰 -Also notice that Deta correctly handles HTTPS for you, so you don't have to take care of that and can be sure that your clients will have a secure encrypted connection. ✅ 🔒 +Remarquez Ă©galement que Deta gĂšre correctement HTTPS pour vous, vous n'avez donc pas Ă  vous en occuper et pouvez ĂȘtre sĂ»r que vos clients auront une connexion cryptĂ©e sĂ©curisĂ©e. ✅ 🔒 -## Check the Visor +## VĂ©rifiez le Visor -From your docs UI (they will be in a URL like `https://qltnci.deta.dev/docs`) send a request to your *path operation* `/items/{item_id}`. +À partir de l'interface graphique de votre documentation (dans une URL telle que `https://qltnci.deta.dev/docs`) +envoyez une requĂȘte Ă  votre *opĂ©ration de chemin* `/items/{item_id}`. -For example with ID `5`. +Par exemple avec l'ID `5`. -Now go to https://web.deta.sh. +Allez maintenant sur https://web.deta.sh. -You will see there's a section to the left called "Micros" with each of your apps. +Vous verrez qu'il y a une section Ă  gauche appelĂ©e "Micros" avec chacune de vos applications. -You will see a tab with "Details", and also a tab "Visor", go to the tab "Visor". +Vous verrez un onglet avec "Details", et aussi un onglet "Visor", allez Ă  l'onglet "Visor". -In there you can inspect the recent requests sent to your app. +Vous pouvez y consulter les requĂȘtes rĂ©centes envoyĂ©es Ă  votre application. -You can also edit them and re-play them. +Vous pouvez Ă©galement les modifier et les réécouter. -## Learn more +## En savoir plus -At some point you will probably want to store some data for your app in a way that persists through time. For that you can use Deta Base, it also has a generous **free tier**. +À un moment donnĂ©, vous voudrez probablement stocker certaines donnĂ©es pour votre application d'une maniĂšre qui +persiste dans le temps. Pour cela, vous pouvez utiliser Deta Base, il dispose Ă©galement d'un gĂ©nĂ©reux **plan gratuit**. -You can also read more in the Deta Docs. +Vous pouvez Ă©galement en lire plus dans la documentation Deta.