Document how plugin settings are used #6974

Closed
opened 2025-12-29 19:47:22 +01:00 by adam · 2 comments
Owner

Originally created by @hagbarddenstore on GitHub (Sep 12, 2022).

Originally assigned to: @jeremystretch on GitHub.

Change Type

Addition

Area

Functionality/features

Proposed Changes

In the plugin development section, it is not documented how a plugin should access its own settings.

from django.conf import settings

settings.PLUGINS_CONFIG['plugin_name']['settings_key']

This method works and is Django standard, but NetBox populates the dict with the defaults from the plugin configuration.

I think this should be documented.

Originally created by @hagbarddenstore on GitHub (Sep 12, 2022). Originally assigned to: @jeremystretch on GitHub. ### Change Type Addition ### Area Functionality/features ### Proposed Changes In the plugin development section, it is not documented how a plugin should access its own settings. ``` from django.conf import settings settings.PLUGINS_CONFIG['plugin_name']['settings_key'] ``` This method works and is Django standard, but NetBox populates the dict with the defaults from the plugin configuration. I think this should be documented.
adam added the status: acceptedtype: documentation labels 2025-12-29 19:47:22 +01:00
adam closed this issue 2025-12-29 19:47:22 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 13, 2022):

Maybe it makes sense to provide a helper utility and document its use instead? That might be a bit cleaner for developers, and provide a hook layer for potential future use. Something like:

from extras.plugins import get_plugin_config

myvar = get_plugin_config('plugin_name', 'myvar')
@jeremystretch commented on GitHub (Sep 13, 2022): Maybe it makes sense to provide a helper utility and document its use instead? That might be a bit cleaner for developers, and provide a hook layer for potential future use. Something like: ```python from extras.plugins import get_plugin_config myvar = get_plugin_config('plugin_name', 'myvar') ```
Author
Owner

@DanSheps commented on GitHub (Sep 20, 2022):

I think an associated templatetag might also be wise.

@DanSheps commented on GitHub (Sep 20, 2022): I think an associated templatetag might also be wise.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6974