Skip to content

Commit ebd9565

Browse files
committed
review corrections and F1 sku
1 parent e40d282 commit ebd9565

File tree

4 files changed

+18
-26
lines changed

4 files changed

+18
-26
lines changed
Loading

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

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
---
2-
title: 'Tutorial: Build a Python Django web app with PostgreSQL in Azure App Service'
3-
description: Learn how to run a PostgreSQL database-driven Python Django web app in Azure.
4-
services: app-service\web
5-
documentationcenter: python
6-
author: cephalin
7-
manager: gwallace
8-
ms.service: app-service-web
9-
ms.workload: web
2+
title: 'Tutorial: Linux Python app with Postgre'
3+
description: Learn how to get a Linux Python app working in Azure App Service, with connection to a PostgreSQL database in Azure. Django is used in this tutorial.
104
ms.devlang: python
115
ms.topic: tutorial
126
ms.date: 12/14/2019
13-
ms.author: cephalin
147
ms.custom: [mvc, seodec18, seo-python-october2019]
158
---
16-
# Tutorial: Run a Python Django web app with PostgreSQL in Azure App Service
9+
# Tutorial: Run a Python (Django) web app with PostgreSQL in Azure App Service
1710

18-
[Azure App Service](app-service-linux-intro.md) provides a highly scalable, self-patching web hosting service. [Azure Database for PostgreSQL](/azure/postgresql/overview) is a relational database service based on the open-source PostgreSQL database engine. This tutorial shows how to connect a data-driven Python Django web app to an Azure Database for PostgreSQL database, and deploy and run the app on Azure App Service.
11+
[Azure App Service](app-service-linux-intro.md) provides a highly scalable, self-patching web hosting service. This tutorial shows how to connect a data-driven Python Django web app to an Azure Database for PostgreSQL database, and deploy and run the app on Azure App Service.
1912

2013
![Python Django web app in Azure App Service](./media/tutorial-python-postgresql-app/run-python-django-app-in-azure.png)
2114

2215
In this tutorial, you learn how to:
2316

2417
> [!div class="checklist"]
25-
> * Connect a Python Django web app to a local PostgreSQL database
26-
> * Create an Azure Database for PostgreSQL database and connect the web app to it
18+
> * Create an Azure Database for PostgreSQL database and connect a web app to it
2719
> * Deploy the web app to Azure App Service
2820
> * View diagnostic logs
2921
> * Manage the web app in the Azure portal
@@ -39,7 +31,7 @@ Before you start this tutorial:
3931
- Install [Python 3](https://www.python.org/downloads/).
4032
- Install and run [PostgreSQL](https://www.postgresql.org/download/).
4133

42-
## Create a local PostgreSQL database
34+
## Test PostgreSQL installation and create a database
4335

4436
First, connect to your local PostgreSQL server and create a database:
4537

@@ -49,7 +41,7 @@ In a local terminal window, run `psql` to connect to your local PostgreSQL serve
4941
psql -U postgres
5042
```
5143

52-
If the connection isn't successful, make sure your PostgreSQL server is running, or restart it if necessary.
44+
If your connection is successful, your PostgreSQL database is running. If not, make sure that your local PostgresQL database is started by following the instructions for your operating system at [Downloads - PostgreSQL Core Distribution](https://www.postgresql.org/download/).
5345

5446
Create a new database called *pollsdb*, and set up a database user named *manager* with password *supersecretpass*:
5547

@@ -62,11 +54,11 @@ GRANT ALL PRIVILEGES ON DATABASE pollsdb TO manager;
6254
Type `\q` to exit the PostgreSQL client.
6355

6456
<a name="step2"></a>
65-
## Create and run the Python app
57+
## Create and run the local Python app
6658

6759
Next, set up and run the sample Python Django web app.
6860

69-
The [djangoapp](https://github.com/Azure-Samples/djangoapp) sample repository contains the data-driven [Django](https://www.djangoproject.com/) polls app you get by following [Writing your first Django app](https://docs.djangoproject.com/en/2.1/intro/tutorial01/) in the Django documentation. You can connect this, or any other data-driven Python Django web app, to a local or cloud PostgreSQL database back end.
61+
The [djangoapp](https://github.com/Azure-Samples/djangoapp) sample repository contains the data-driven [Django](https://www.djangoproject.com/) polls app you get by following [Writing your first Django app](https://docs.djangoproject.com/en/2.1/intro/tutorial01/) in the Django documentation.
7062

7163
### Clone the sample app
7264

@@ -126,7 +118,7 @@ System check identified no issues (0 silenced).
126118
December 13, 2019 - 10:54:59
127119
Django version 2.1.2, using settings 'azuresite.settings'
128120
Starting development server at http://127.0.0.1:8000/
129-
Quit the server with CTRL-BREAK.
121+
Quit the server with CONTROL-C.
130122
```
131123

132124
Go to *http:\//localhost:8000* in a browser. You should see the message **No polls are available**.
@@ -281,7 +273,7 @@ In this step, you deploy the Azure Database for PostgreSQL database-connected Py
281273

282274
### Configure repository
283275

284-
You need to change and add some settings in your *djangoapp/azuresite/settings.py* file to work with Azure App Service.
276+
Because this tutorial uses a Django sample, you need to change and add some settings in your *djangoapp/azuresite/settings.py* file to work with Azure App Service.
285277

286278
1. Django validates the `HTTP_HOST` header in incoming requests. For your Django web app to work in App Service, you need to add the fully qualified domain name of the app to the allowed hosts.
287279

@@ -321,7 +313,7 @@ Commit your changes into your fork of the *djangoapp* repository:
321313
git commit -am "configure for App Service"
322314
```
323315

324-
### Configure deployment user
316+
### Configure a deployment user
325317

326318
[!INCLUDE [Configure deployment user](../../../includes/configure-deployment-user-no-h.md)]
327319

@@ -399,7 +391,7 @@ In the [Azure portal](https://portal.azure.com), search for and select the app y
399391

400392
![Navigate to your Python Django app in the Azure portal](./media/tutorial-python-postgresql-app/navigate-to-django-app-in-app-services-in-the-azure-portal.png)
401393

402-
By default, the portal shows your app's **Overview** page. This page gives you a view of how your app is doing. Here, you can also perform basic management tasks like browse, stop, swap, restart, and delete. The tabs on the left side of the page show the different configuration pages you can open.
394+
By default, the portal shows your app's **Overview** page. This page gives you a view of how your app is doing. Here, you can also perform basic management tasks like browse, stop, restart, and delete. The tabs on the left side of the page show the different configuration pages you can open.
403395

404396
![Manage your Python Django app in the Overview page in the Azure portal](./media/tutorial-python-postgresql-app/manage-django-app-in-app-services-in-the-azure-portal.png)
405397

includes/app-service-web-create-app-service-plan-linux-no-h.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ services: app-service
55
author: cephalin
66
ms.service: app-service
77
ms.topic: "include"
8-
ms.date: 10/24/2018
8+
ms.date: 12/20/2019
99
ms.author: cephalin
1010
ms.custom: "include file"
1111
---
1212
In the Cloud Shell, create an App Service plan in the resource group with the [`az appservice plan create`](/cli/azure/appservice/plan?view=azure-cli-latest#az-appservice-plan-create) command.
1313

1414
<!-- [!INCLUDE [app-service-plan](app-service-plan-linux.md)] -->
1515

16-
The following example creates an App Service plan named `myAppServicePlan` in the **Basic** pricing tier (`--sku B1`) and in a Linux container (`--is-linux`).
16+
The following example creates an App Service plan named `myAppServicePlan` in the **Free** pricing tier (`--sku F1`) and in a Linux container (`--is-linux`).
1717

1818
```azurecli-interactive
19-
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku B1 --is-linux
19+
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku F1 --is-linux
2020
```
2121

2222
When the App Service plan has been created, the Azure CLI shows information similar to the following example:

includes/app-service-web-git-push-to-azure-no-h.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ ms.author: cephalin
1010
ms.custom: "include file"
1111
---
1212

13-
Back in the _local terminal window_, add an Azure remote to your local Git repository. Replace _&lt;deploymentLocalGitUrl-from-create-step>_ with the URL of the Git remote that you saved from [Create a web app](#create-a-web-app).
13+
Back in the local terminal window, add an Azure remote to your local Git repository. Replace *\<deploymentLocalGitUrl-from-create-step>* with the URL of the Git remote that you saved from [Create a web app](#create-a-web-app).
1414

1515
```bash
1616
git remote add azure <deploymentLocalGitUrl-from-create-step>
1717
```
1818

19-
Push to the Azure remote to deploy your app with the following command. When prompted for credentials by Git Credential Manager, make sure that you enter the credentials you created in Configure a deployment user, not the credentials you use to sign in to the Azure portal.
19+
Push to the Azure remote to deploy your app with the following command. When Git Credential Manager prompts you for credentials, make sure that you enter the credentials you created in [Configure a deployment user](#configure-a-deployment-user), not the credentials you use to sign in to the Azure portal.
2020

2121
```bash
2222
git push azure master

0 commit comments

Comments
 (0)