Skip to content

Commit c0603ca

Browse files
authored
Updating spacing
1 parent 0dbbd89 commit c0603ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,26 @@ Add the following key-values to the App Configuration store. For more informatio
171171
message found: True
172172
test.message found: False
173173
```
174+
174175
## Web app usage
176+
175177
You can use Azure App Configuration in your existing python Web Apps by adding the following lines of code into your `settings.py` (For Django) or `app.py` (for Flask) files.
176178
```python
177179
selects = {SettingSelector(key_filter="<your-key-filter>")}
178180
config = load(connection_string=os.environ.get("AZURE_APPCONFIG_CONNECTION_STRING"),
179181
selects=selects,
180182
trim_prefixes=["<prefix-to-trim>"])
181183
```
184+
182185
### Configuration settings in Django
186+
183187
To update individual configuration settings in the Django `settings.py` file, you can reference them from the provider object. e.g.,
184188
```python
185189
MESSAGE = config.get("message")
186190
```
187191

188192
### Configuration settings in Flask
193+
189194
You can update the in-built configuration object in Flask by passing your App Configuration Provider object to the `update` function of your flask app instance in `app.py`:
190195
```python
191196
# NOTE: This will override all existing configuration settings with the same key name.
@@ -195,7 +200,6 @@ app.update(config)
195200
json_value = app.config.get("my_json")
196201
```
197202

198-
199203
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.
200204

201205
## Clean up resources

0 commit comments

Comments
 (0)