Skip to content

Commit 794cf8d

Browse files
authored
Updating Django example
1 parent 2dce3f7 commit 794cf8d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

articles/azure-app-configuration/quickstart-python-provider.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,14 @@ You can use Azure App Configuration in your existing Django web apps by adding t
194194
CONFIG = load(connection_string=os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING"))
195195
```
196196

197-
To update individual configuration settings in the Django `settings.py` file, you can reference them from the provider object. For example:
197+
To access individual configuration settings in the Django views, you can reference them from the provider object in Django settings. For example, in `views.py`:
198198
```python
199-
MESSAGE = CONFIG.get("message")
200-
```
199+
# Import Django settings
200+
from django.conf import settings
201201

202+
# Access a configuration setting from Django settings instance.
203+
MESSAGE = settings.CONFIG.get("message")
204+
```
202205
---
203206

204207
Full code samples on how Azure App Configuration is used in python web apps can be found in the [Azure App Configuration](https://github.com/Azure/AppConfiguration/tree/main/examples/Python) repo.

0 commit comments

Comments
 (0)