1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #10543: Introduce get_plugin_config() utility function

This commit is contained in:
jeremystretch
2022-11-03 13:18:58 -04:00
parent e7f54c5867
commit 13afc52617
3 changed files with 35 additions and 4 deletions

View File

@ -117,11 +117,11 @@ NetBox looks for the `config` variable within a plugin's `__init__.py` to load i
All required settings must be configured by the user. If a configuration parameter is listed in both `required_settings` and `default_settings`, the default setting will be ignored.
!!! tip "Accessing Config Parameters"
Plugin configuration parameters can be accessed in `settings.PLUGINS_CONFIG`, mapped by plugin name. For example:
Plugin configuration parameters can be accessed using the `get_plugin_config()` function. For example:
```python
from django.conf import settings
settings.PLUGINS_CONFIG['myplugin']['verbose_name']
from extras.plugins import get_plugin_config
get_plugin_config('my_plugin', 'verbose_name')
```
#### Important Notes About `django_apps`