Skip to content

Commit 6d4f53f

Browse files
committed
Cleaned up some django/flask detritus
1 parent 7034aff commit 6d4f53f

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

articles/app-service/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
href: tutorial-php-mysql-app.md
155155
- name: Node.js with MongoDB
156156
href: tutorial-nodejs-mongodb-app.md
157-
- name: Python with Postgres
157+
- name: Python with Postgres (Flask/Django)
158158
href: tutorial-python-postgresql-app.md
159159
- name: Python with Postgres (FastAPI)
160160
href: tutorial-python-postgresql-app-fastapi.md

articles/app-service/tutorial-python-postgresql-app-fastapi.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In this tutorial, you'll deploy a data-driven Python web app (**[FastAPI](https:
2121
::: zone pivot="azure-portal"
2222

2323
* An Azure account with an active subscription. If you don't have an Azure account, you [can create one for free](https://azure.microsoft.com/free/python).
24-
* Knowledge of Python with Flask development or [Python with Django development](/training/paths/django-create-data-driven-websites/)
24+
* Knowledge of Python with FastAPI development
2525

2626
::: zone-end
2727

@@ -45,7 +45,7 @@ azd up
4545

4646
## Sample application
4747

48-
Sample Python application using FastAPI framework is provided to help you follow along with this tutorial. To deploy it without running it locally, skip this part.
48+
A sample Python application using FastAPI framework is provided to help you follow along with this tutorial. To deploy it without running it locally, skip this part.
4949

5050
To run the application locally, make sure you have [Python 3.8 or higher](https://www.python.org/downloads/) and [PostgreSQL](https://www.postgresql.org/download/) installed locally. Then, clone the sample repository's `starter-no-infra` branch and change to the repository root.
5151

@@ -110,7 +110,7 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps
110110
You can also navigate to the [creation wizard](https://portal.azure.com/?feature.customportal=false#create/Microsoft.AppServiceWebAppDatabaseV3) directly.
111111
:::column-end:::
112112
:::column:::
113-
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-1.png" alt-text="A screenshot showing how to use the search box in the top tool bar to find the Web App + Database creation wizard (Flask)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-1.png":::
113+
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-1.png" alt-text="A screenshot showing how to use the search box in the top tool bar to find the Web App + Database creation wizard (FastAPI)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-1.png":::
114114
:::column-end:::
115115
:::row-end:::
116116
:::row:::
@@ -126,7 +126,7 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps
126126
1. After validation completes, select **Create**.
127127
:::column-end:::
128128
:::column:::
129-
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-2.png" alt-text="A screenshot showing how to configure a new app and database in the Web App + Database wizard (Flask)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-2.png":::
129+
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-2.png" alt-text="A screenshot showing how to configure a new app and database in the Web App + Database wizard (FastAPI)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-2.png":::
130130
:::column-end:::
131131
:::row-end:::
132132
:::row:::
@@ -140,7 +140,7 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps
140140
- **Private DNS zone** → Enables DNS resolution of the PostgreSQL server in the virtual network.
141141
:::column-end:::
142142
:::column:::
143-
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-3.png" alt-text="A screenshot showing the deployment process completed (Flask)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-3.png":::
143+
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-3.png" alt-text="A screenshot showing the deployment process completed (FastAPI)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-create-app-postgres-3.png":::
144144
:::column-end:::
145145
:::row-end:::
146146
:::row:::
@@ -297,7 +297,7 @@ With the PostgreSQL database protected by the virtual network, the easiest way t
297297
Congratulations, you're running a web app in Azure App Service, with secure connectivity to Azure Database for PostgreSQL.
298298
:::column-end:::
299299
:::column:::
300-
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png" alt-text="A screenshot of the Flask web app with PostgreSQL running in Azure showing restaurants and restaurant reviews (Flask)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png":::
300+
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png" alt-text="A screenshot of the FastAPI web app with PostgreSQL running in Azure showing restaurants and restaurant reviews (FastAPI)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png":::
301301
:::column-end:::
302302
:::row-end:::
303303

@@ -376,7 +376,7 @@ In this step, you create the Azure resources and deploy a sample app to App Serv
376376
cd msdocs-fastapi-postgresql-sample-app
377377
```
378378

379-
This cloned branch is your starting point. It contains a simple data-drive Flask application.
379+
This cloned branch is your starting point. It contains a simple data-drive FastAPI application.
380380

381381
1. From the repository root, run `azd init`.
382382

@@ -457,9 +457,9 @@ With the PostgreSQL database protected by the virtual network, the easiest way t
457457
Open SSH session to App Service container at: https://<app-name>.scm.azurewebsites.net/webssh/host
458458
</pre>
459459
460-
1. In the SSH terminal, run `flask db upgrade`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
460+
1. In the SSH terminal, run `python3 src/fastapi_app/seed_data.py`. If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
461461
462-
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-generate-db-schema-flask-2.png" alt-text="A screenshot showing the commands to run in the SSH shell and their output (Flask)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-generate-db-schema-flask-2.png":::
462+
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-generate-db-schema-flask-2.png" alt-text="A screenshot showing the commands to run in the SSH shell and their output (FastAPI)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-generate-db-schema-flask-2.png":::
463463
464464
> [!NOTE]
465465
> Only changes to files in `/home` can persist beyond app restarts. Changes outside of `/home` aren't persisted.
@@ -478,7 +478,7 @@ With the PostgreSQL database protected by the virtual network, the easiest way t
478478
479479
2. Add a few restaurants to the list.
480480
481-
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png" alt-text="A screenshot of the Flask web app with PostgreSQL running in Azure showing restaurants and restaurant reviews (Flask)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png":::
481+
:::image type="content" source="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png" alt-text="A screenshot of the FastAPI web app with PostgreSQL running in Azure showing restaurants and restaurant reviews (FastAPI)." lightbox="./media/tutorial-python-postgresql-app-fastapi/azure-portal-browse-app-2.png":::
482482
483483
Congratulations, you're running a web app in Azure App Service, with secure connectivity to Azure Database for PostgreSQL.
484484
@@ -488,7 +488,7 @@ Azure App Service can capture console logs to help you diagnose issues with your
488488
489489
The sample app includes `print()` statements to demonstrate this capability as shown in the following snippet.
490490
491-
:::code language="python" source="~/msdocs-flask-postgresql-sample-app/app.py" range="37-41" highlight="3":::
491+
:::code language="python" source="~/msdocs-fastapi-postgresql-sample-app/src/fastapi_app/app.py" range="33-40" highlight="3":::
492492
493493
In the azd output, find the link to stream App Service logs and navigate to it in the browser. The link looks like this in the azd output:
494494
@@ -524,7 +524,6 @@ If you encounter any errors related to connecting to the database, check if the
524524
- [How much does this setup cost?](#how-much-does-this-setup-cost)
525525
- [How do I connect to the PostgreSQL server that's secured behind the virtual network with other tools?](#how-do-i-connect-to-the-postgresql-server-thats-secured-behind-the-virtual-network-with-other-tools)
526526
- [How does local app development work with GitHub Actions?](#how-does-local-app-development-work-with-github-actions)
527-
- [How is the Django sample configured to run on Azure App Service?](#how-is-the-django-sample-configured-to-run-on-azure-app-service)
528527
529528
#### How much does this setup cost?
530529

0 commit comments

Comments
 (0)