Skip to content

Commit 8ef2f9c

Browse files
committed
validation
1 parent 78f2d74 commit 8ef2f9c

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Type \q to exit `psql`.
9696
In a terminal window, run the following commands to clone the sample app repository, and change to the new working directory:
9797

9898
```
99-
git clone https://github.com/cephalin/djangoapp
99+
git clone https://github.com/Azure-Samples/djangoapp
100100
cd djangoapp
101101
```
102102

@@ -106,7 +106,7 @@ The djangoapp sample repository contains the data-driven [Django](https://www.dj
106106

107107
To set up your local development environment and run the sample app for the first time, run the following commands:
108108

109-
# [Docker container](#tab/container)
109+
# [Docker container](#tab/docker)
110110

111111
```bash
112112
# Configure the Python virtual environment
@@ -227,27 +227,15 @@ Also, a Django app by default uses Sqlite3 as the database. To run your app in p
227227

228228
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
229229
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
230-
231-
# Configure Postgres database
232-
DATABASES = {
233-
'default': {
234-
'ENGINE': 'django.db.backends.postgresql',
235-
'NAME': os.environ['DBNAME'],
236-
'HOST': os.environ['DBHOST'],
237-
'USER': os.environ['DBUSER'],
238-
'PASSWORD': os.environ['DBPASS']
239-
}
240-
}
241230
```
242231

243232
Briefly, *azuresite/production.py* does the following:
244233

245234
- Inherit all settings from *azuresite/settings.py*.
246235
- Add the fully qualified domain name of the App Service app to the allowed hosts.
247236
- Use [WhiteNoise](https://whitenoise.evans.io/en/stable/) to enable serving static files in production. The WhiteNoise package is already included in *requirements.txt*.
248-
- Add configuration for PostgreSQL database. The [psycopg2-binary](https://pypi.org/project/psycopg2-binary/) package is already included in *requirements.txt*.
249237

250-
1. In *manage.py*, change the following line:
238+
1. In *azuresite/wsgi.py*, change the following line:
251239

252240
```python
253241
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'azuresite.settings')
@@ -262,9 +250,7 @@ Also, a Django app by default uses Sqlite3 as the database. To run your app in p
262250
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'azuresite.settings')
263251
```
264252

265-
1. In *azuresite/wsgi.py*, make the same change as above.
266-
267-
In App Service, you use *manage.py* to run database migrations, and App Service uses *azuresite/wsgi.py* to run your Django app in production. This change in both files ensures that the production settings are used in both cases.
253+
App Service uses *azuresite/wsgi.py* to run your Django app in production. This change ensures that the production settings are used.
268254

269255
## Sign in to Azure CLI
270256

0 commit comments

Comments
 (0)