Skip to content

Commit ac7a3a6

Browse files
committed
,ore django aks edits
1 parent 181010b commit ac7a3a6

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

articles/postgresql/flexible-server/tutorial-django-aks-database.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ In this quickstart, you deploy a Django application on Azure Kubernetes Service
2020
**[AKS](../../aks/intro-kubernetes.md)** is a managed Kubernetes service that lets you quickly deploy and manage clusters. **[Azure Database for PostgreSQL - Flexible Server ](overview.md)** is a fully managed database service designed to provide more granular control and flexibility over database management functions and configuration settings.
2121

2222
> [!NOTE]
23-
> - This quickstart assumes a basic understanding of Kubernetes concepts, Django and PostgreSQL.
23+
> This quickstart assumes a basic understanding of Kubernetes concepts, Django and PostgreSQL.
2424
2525
## Pre-requisites
26+
27+
2628
[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)]
2729

2830
- Launch [Azure Cloud Shell](https://shell.azure.com) in new browser window. You can [install Azure CLI](/cli/azure/install-azure-cli#install) on your local machine too. If you're using a local install, login with Azure CLI by using the [az login](/cli/azure/reference-index#az-login) command. To finish the authentication process, follow the steps displayed in your terminal.
@@ -154,6 +156,7 @@ DATABASES={
154156
```
155157

156158
### Generate a requirements.txt file
159+
157160
Create a ```requirements.txt``` file to list out the dependencies for the Django Application. Here is an example ```requirements.txt``` file. You can use [``` pip freeze > requirements.txt```](https://pip.pypa.io/en/stable/reference/pip_freeze/) to generate a requirements.txt file for your existing application.
158161

159162
``` text
@@ -165,6 +168,7 @@ pytz==2020.4
165168
```
166169

167170
### Create a Dockerfile
171+
168172
Create a new file named ```Dockerfile``` and copy the code snippet below. This Dockerfile in setting up Python 3.8 and installing all the requirements listed in requirements.txt file.
169173

170174
```docker
@@ -190,11 +194,11 @@ RUN pip install -r requirements.txt
190194
191195
# Run the application:
192196
193-
194197
CMD python manage.py runserver 0.0.0.0:8000
195198
```
196199

197200
### Build your image
201+
198202
Make sure you're in the directory ```my-django-app``` in a terminal using the ```cd``` command. Run the following command to build your bulletin board image:
199203

200204
```bash
@@ -204,18 +208,18 @@ docker build --tag myblog:latest .
204208
Deploy your image to [Docker hub](https://docs.docker.com/get-started/part3/#create-a-docker-hub-repository-and-push-your-image) or [Azure Container registry](../../container-registry/container-registry-get-started-azure-cli.md).
205209

206210
> [!IMPORTANT]
207-
>If you are using Azure container registry (ACR), then run the ```az aks update``` command to attach ACR account with the AKS cluster.
211+
> If you are using Azure container registry (ACR), then run the ```az aks update``` command to attach ACR account with the AKS cluster.
208212
>
209-
>```azurecli-interactive
210-
>az aks update -n djangoappcluster -g django-project --attach-acr <your-acr-name>
213+
> ```azurecli-interactive
214+
> az aks update -n djangoappcluster -g django-project --attach-acr <your-acr-name>
211215
> ```
212216
213217
## Create Kubernetes manifest file
214218
215219
A Kubernetes manifest file defines a desired state for the cluster, such as what container images to run. Let's create a manifest file named ```djangoapp.yaml``` and copy in the following YAML definition.
216220
217-
>[!IMPORTANT]
218-
> - Update ```env``` section below with your ```SERVERNAME```, ```YOUR-DATABASE-USERNAME```, ```YOUR-DATABASE-PASSWORD``` of your postgres flexible server.
221+
> [!IMPORTANT]
222+
> Update ```env``` section below with your ```SERVERNAME```, ```YOUR-DATABASE-USERNAME```, ```YOUR-DATABASE-PASSWORD``` of your postgres flexible server.
219223
220224
```yaml
221225
apiVersion: apps/v1
@@ -272,6 +276,7 @@ spec:
272276
```
273277
274278
## Deploy Django to AKS cluster
279+
275280
Deploy the application using the [kubectl apply](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply) command and specify the name of your YAML manifest:
276281

277282
```console
@@ -312,9 +317,9 @@ django-app LoadBalancer 10.0.37.27 52.179.23.131 80:30572/TCP 2m
312317

313318
Now open a web browser to the external IP address of your service (http://\<service-external-ip-address\>) and view the Django application.
314319

315-
>[!NOTE]
320+
> [!NOTE]
316321
> - Currently the Django site is not using HTTPS. It is recommended to [ENABLE TLS with your own certificates](../../aks/ingress-own-tls.md).
317-
> - You can enable [HTTP routing](../../aks/http-application-routing.md) for your cluster. When http routing is enabled, it configures an Ingress controller in your AKS cluster. As applications are deployed, the solution also creates publicly accessible DNS names for application endpoints.
322+
> - You can enable [HTTP routing](../../aks/http-application-routing.md) for your cluster. When http routing is enabled, it configures an Ingress controller in your AKS cluster. As > > applications are deployed, the solution also creates publicly accessible DNS names for application endpoints.
318323
319324
## Run database migrations
320325

0 commit comments

Comments
 (0)