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/azure-app-configuration/quickstart-python-provider.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,32 @@ Add the following key-values to the App Configuration store. For more informatio
171
171
message found: True
172
172
test.message found: False
173
173
```
174
+
## Web app usage
175
+
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.
To update individual configuration settings in the Django `settings.py` file, you can reference them from the provider object. e.g.,
184
+
```python
185
+
MESSAGE= config.get("message")
186
+
```
187
+
188
+
### Configuration settings in Flask
189
+
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`:
190
+
```python
191
+
#NOTE: This will override all existing configuration settings with the same key name.
192
+
app.update(config)
193
+
194
+
# Access a configuration setting directly from within flask configuration
195
+
json_value = app.config.get("my_json")
196
+
```
197
+
198
+
199
+
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.
0 commit comments