From 66a91748596b506dc904d4de7eebe8484c06f282 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 16 Sep 2026 09:12:28 +0200 Subject: [PATCH] Fix ModuleNotFoundError on plugin load: use relative resource paths PluginConfig._load_resource() prepends self.__module__ (already 'netbox_rack_concept') to the configured path, so 'menu' and 'template_extensions' must be given relative to the plugin package ('navigation.menu', 'template_content.template_extensions'), not prefixed with 'netbox_rack_concept.' again. The prefixed form made Django try to import 'netbox_rack_concept.netbox_rack_concept...', which doesn't exist, crashing manage.py on every command. Co-Authored-By: Claude Sonnet 5 --- netbox_rack_concept/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/netbox_rack_concept/__init__.py b/netbox_rack_concept/__init__.py index fd7bbba..04cd399 100644 --- a/netbox_rack_concept/__init__.py +++ b/netbox_rack_concept/__init__.py @@ -12,8 +12,10 @@ class RackConceptConfig(PluginConfig): base_url = 'rack-concepts' min_version = '4.6.0' max_version = '4.6.99' - menu = 'netbox_rack_concept.navigation.menu' - template_extensions = 'netbox_rack_concept.template_content.template_extensions' + # These paths are relative to this module (NetBox prepends self.__module__), + # so they must NOT be prefixed with 'netbox_rack_concept.' again. + menu = 'navigation.menu' + template_extensions = 'template_content.template_extensions' default_settings = { # Defaults used when a concept is created from scratch.