Skip to content

Commit d3828c7

Browse files
authored
Merge pull request #84972 from msangapu-msft/DjangoSEO
Django seo
2 parents 2feafcf + 148bd02 commit d3828c7

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

articles/app-service/containers/quickstart-python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Deploy your first Python hello world app in Azure App Service on Li
44
services: app-service\web
55
documentationcenter: ''
66
author: cephalin
7-
manager: jeconnoc
7+
manager: gwallace
88
editor: ''
99

1010
ms.assetid:
@@ -197,7 +197,7 @@ The left menu provides different pages for configuring your app.
197197
## Next steps
198198

199199
> [!div class="nextstepaction"]
200-
> [Tutorial: Python app with PostgreSQL](tutorial-python-postgresql-app.md)
200+
> [Tutorial: Python (Django) web app with PostgreSQL](tutorial-python-postgresql-app.md)
201201
202202
> [!div class="nextstepaction"]
203203
> [Configure Python app](how-to-configure-python.md)

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

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
---
2-
title: Python (Django) with PostgreSQL on Linux - Azure App Service | Microsoft Docs
3-
description: Learn how to run a data-driven Python app in Azure, with connection to a PostgreSQL database. Django is used in the tutorial.
2+
title: Python (Django) web app with PostgreSQL on Linux - Azure App Service | Microsoft Docs
3+
description: Learn how to run a data-driven Python (Django) web app in Azure, with connection to a PostgreSQL database.
44
services: app-service\web
55
documentationcenter: python
66
author: cephalin
7-
manager: jeconnoc
7+
manager: gwallace
88
ms.service: app-service-web
99
ms.workload: web
1010
ms.devlang: python
1111
ms.topic: tutorial
1212
ms.date: 03/27/2019
1313
ms.author: cephalin
14-
ms.reviewer: beverst
1514
ms.custom: mvc
1615
ms.custom: seodec18
1716
---
18-
# Build a Python and PostgreSQL app in Azure App Service
17+
# Build a Python (Django) web app with PostgreSQL in Azure App Service
1918

20-
[App Service on Linux](app-service-linux-intro.md) provides a highly scalable, self-patching web hosting service. This tutorial shows how to create a data-driven Python app, using PostgreSQL as the database back end. When you are done, you have a Django application running in App Service on Linux.
19+
[App Service on Linux](app-service-linux-intro.md) provides a highly scalable, self-patching web hosting service. This tutorial shows how to create a data-driven Python (Django) web app, using PostgreSQL as the database back-end. When you are done, you have a Django web application running in Azure App Service on Linux.
2120

22-
![Python Django app in App Service on Linux](./media/tutorial-python-postgresql-app/django-admin-azure.png)
21+
![Python Django web app in App Service on Linux](./media/tutorial-python-postgresql-app/django-admin-azure.png)
2322

2423
In this tutorial, you learn how to:
2524

2625
> [!div class="checklist"]
2726
> * Create a PostgreSQL database in Azure
28-
> * Connect a Python app to PostgreSQL
29-
> * Deploy the app to Azure
27+
> * Connect a Python web app to PostgreSQL
28+
> * Deploy the Python web app to Azure
3029
> * View diagnostic logs
31-
> * Manage the app in the Azure portal
30+
> * Manage the Python web app in the Azure portal
3231
3332
> [!NOTE]
3433
> Before creating an Azure Database for PostgreSQL, please check [which compute generation is available in your region](https://docs.microsoft.com/azure/postgresql/concepts-pricing-tiers#compute-generations-and-vcores).
@@ -88,7 +87,7 @@ git clone https://github.com/Azure-Samples/djangoapp.git
8887
cd djangoapp
8988
```
9089

91-
This sample repository contains a [Django](https://www.djangoproject.com/) application. It's the same data-driven app you would get by following the [getting started tutorial in the Django documentation](https://docs.djangoproject.com/en/2.1/intro/tutorial01/). This tutorial doesn't teach you Django, but shows you how to take deploy and run a Django app (or another data-driven Python app) to App Service.
90+
This sample repository contains a [Django](https://www.djangoproject.com/) application. It's the same data-driven app you would get by following the [getting started tutorial in the Django documentation](https://docs.djangoproject.com/en/2.1/intro/tutorial01/). This tutorial doesn't teach you Django, but shows you how to take deploy and run a Django web app (or another data-driven Python app) to Azure App Service.
9291

9392
### Configure environment
9493

@@ -124,7 +123,7 @@ Once the admin user is created, run the Django server.
124123
python manage.py runserver
125124
```
126125

127-
When the app is fully loaded, you see something similar to the following message:
126+
When the Django web app is fully loaded, you see something similar to the following message:
128127

129128
```bash
130129
Performing system checks...
@@ -211,7 +210,7 @@ az postgres server firewall-rule create --resource-group myResourceGroup --serve
211210

212211
## Connect Python app to production database
213212

214-
In this step, you connect your Django sample app to the Azure Database for PostgreSQL server you created.
213+
In this step, you connect your Django web app to the Azure Database for PostgreSQL server you created.
215214

216215
### Create empty database and user access
217216

@@ -279,11 +278,10 @@ In this step, you deploy the Postgres-connected Python application to Azure App
279278

280279
### Configure repository
281280

282-
Django validates the `HTTP_HOST` header in incoming requests. For your Django app to work in App Service, you need to add the full-qualified domain name of the app to the allowed hosts. Open _azuresite/settings.py_ and find the `ALLOWED_HOSTS` setting. Change the line to:
281+
Django validates the `HTTP_HOST` header in incoming requests. For your Django web app to work in App Service, you need to add the full-qualified domain name of the app to the allowed hosts. Open _azuresite/settings.py_ and find the `ALLOWED_HOSTS` setting. Change the line to:
283282

284283
```python
285-
ALLOWED_HOSTS = [os.environ['WEBSITE_SITE_NAME'] + '.azurewebsites.net',
286-
'127.0.0.1'] if 'WEBSITE_SITE_NAME' in os.environ else []
284+
ALLOWED_HOSTS = [os.environ['WEBSITE_SITE_NAME'] + '.azurewebsites.net', '127.0.0.1'] if 'WEBSITE_SITE_NAME' in os.environ else []
287285
```
288286

289287
Next, Django doesn't support [serving static files in production](https://docs.djangoproject.com/en/2.1/howto/static-files/deployment/), so you need to enable this manually. For this tutorial, you use [WhiteNoise](https://whitenoise.evans.io/en/stable/). The WhiteNoise package is already included in _requirements.txt_. You just need to configure Django to use it.
@@ -381,13 +379,13 @@ http://<app-name>.azurewebsites.net
381379

382380
You should see the poll question that you created earlier.
383381

384-
App Service detects a Django project in your repository by looking for a _wsgi.py_ in each subdirectory, which is created by `manage.py startproject` by default. When it finds the file, it loads the Django app. For more information on how App Service loads Python apps, see [Configure built-in Python image](how-to-configure-python.md).
382+
App Service detects a Django project in your repository by looking for a _wsgi.py_ in each subdirectory, which is created by `manage.py startproject` by default. When it finds the file, it loads the Django web app. For more information on how App Service loads Python apps, see [Configure built-in Python image](how-to-configure-python.md).
385383

386384
Navigate to `<app-name>.azurewebsites.net` and sign in using same admin user you created. If you like, try creating some more poll questions.
387385

388386
![Python Django application running in locally](./media/tutorial-python-postgresql-app/django-admin-azure.png)
389387

390-
**Congratulations!** You're running a Python app in App Service for Linux.
388+
**Congratulations!** You're running a Python (Django) web app in Azure App Service for Linux.
391389

392390
## Stream diagnostic logs
393391

@@ -413,10 +411,10 @@ In this tutorial, you learned how to:
413411

414412
> [!div class="checklist"]
415413
> * Create a PostgreSQL database in Azure
416-
> * Connect a Python app to PostgreSQL
417-
> * Deploy the app to Azure
414+
> * Connect a Python web app to PostgreSQL
415+
> * Deploy the Python web app to Azure
418416
> * View diagnostic logs
419-
> * Manage the app in the Azure portal
417+
> * Manage the Python web app in the Azure portal
420418
421419
Advance to the next tutorial to learn how to map a custom DNS name to your app.
422420

@@ -426,4 +424,4 @@ Advance to the next tutorial to learn how to map a custom DNS name to your app.
426424
Or, check out other resources:
427425

428426
> [!div class="nextstepaction"]
429-
> [Configure Python app](how-to-configure-python.md)
427+
> [Configure Python app](how-to-configure-python.md)

0 commit comments

Comments
 (0)