Skip to content

Commit 2dce3f7

Browse files
authored
Updating order of Python and Flask examples. Removing unneeded selects.
1 parent 48b72b7 commit 2dce3f7

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

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

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,36 +174,34 @@ Add the following key-values to the App Configuration store. For more informatio
174174
175175
## Django/Flask Application
176176
177-
### [Django](#tab/django)
178-
You can use Azure App Configuration in your existing Django web apps by adding the following lines of code into your `settings.py` file
179-
180-
```python
181-
selects = {SettingSelector(key_filter="<your-key-filter>")}
182-
CONFIG = load(connection_string=os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING"), selects=selects)
183-
```
184-
185-
To update individual configuration settings in the Django `settings.py` file, you can reference them from the provider object. For example:
186-
```python
187-
MESSAGE = CONFIG.get("message")
188-
```
189-
190177
### [Flask](#tab/flask)
191178
You can use Azure App Configuration in your existing Flask web apps by updating its in-built configuration. You can do this by passing your App Configuration Provider object to the `update` function of your flask app instance in `app.py`:
192179
193180
```python
194-
selects = {SettingSelector(key_filter="<your-key-filter>")}
195-
azure_app_config = load(connection_string=os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING"), selects=selects)
181+
azure_app_config = load(connection_string=os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING"))
196182
197183
# NOTE: This will override all existing configuration settings with the same key name.
198184
app.config.update(azure_app_config)
199185
200186
# Access a configuration setting directly from within flask configuration
201-
json_value = app.config.get("my_json")
187+
message = app.config.get("message")
188+
```
189+
190+
### [Django](#tab/django)
191+
You can use Azure App Configuration in your existing Django web apps by adding the following lines of code into your `settings.py` file
192+
193+
```python
194+
CONFIG = load(connection_string=os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING"))
195+
```
196+
197+
To update individual configuration settings in the Django `settings.py` file, you can reference them from the provider object. For example:
198+
```python
199+
MESSAGE = CONFIG.get("message")
202200
```
203201

204202
---
205203

206-
Full code samples on how Azure App Configuration is used in python web apps can be found in the [Azure App Configuration Python Samples](https://github.com/Azure/AppConfiguration/tree/main/examples/Python) repo.
204+
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.
207205

208206
## Clean up resources
209207

0 commit comments

Comments
 (0)