You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/containers/tutorial-python-postgresql-app.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,19 +340,44 @@ To stop the Django server, type Ctrl+C.
340
340
341
341
### Update the app
342
342
343
-
TODOHERE
343
+
Just to see how making app updates works, make a small change in`polls/models.py`. Find the line:
344
344
345
-
### Redeploy code
345
+
```python
346
+
choice_text= models.CharField(max_length=200)
347
+
```
348
+
349
+
And change it to:
350
+
351
+
```python
352
+
choice_text= models.CharField(max_length=100)
353
+
```
354
+
355
+
By changing the data model, you need to create a new Django migration. Do it with the following command:
356
+
357
+
```
358
+
python manage.py makemigrations
359
+
```
346
360
347
-
To redeploy the changes, just run the following command from the repository root:
361
+
You can test your changes locally by running migrations, running the development server, and navigating to *http:\//localhost:8000/admin*:
362
+
363
+
```
364
+
python manage.py migrate
365
+
python manage.py runserver
366
+
```
367
+
368
+
### Redeploy code to Azure
369
+
370
+
To redeploy the changes, run the following command from the repository root:
348
371
349
372
```azurecli
350
373
az webapp up --name <app-name>
351
374
```
352
375
353
-
### Rerun migrations
376
+
App Service detects that the app exists and just deploys the code.
377
+
378
+
### Rerun migrations in Azure
354
379
355
-
To rerun database migrations in App Service, open an SSH session in the browser by navigating to *https://\<app-name>.scm.azurewebsites.net/webssh/host*. Run the following commands:
380
+
Because you made changes to the data model, you need to rerun database migrations in App Service. Open an SSH session in the browser by navigating to *https://\<app-name>.scm.azurewebsites.net/webssh/host*. Run the following commands:
0 commit comments