Help with a plugin I'm coding - unable to see journal or see assignments to contacts #19989
-
Hi All, Hopefully this is the correct place to be putting this. Apologies if not. I'm in the middle of writing a plugin for netbox that allows me to track TLS certificates installed on devices and their expiry dates. Code is available here: https://github.com/NetworkSeb/netbox-certificates The plugin works well, but there's two issues that I just can't get to the bottom of which are probably related but I can't figure out, so I thought I'd drop a message here to see if anyone can advise what I've done wrong! Currently I can't see the 'Journal' tab in the GUI when viewing any of my custom objects (despite extending NetboxModel) I've tested this in version 4.2.x and 4.3.x and get the same issue. I did however follow the create a netbox-plugin for 3.x and then applied the migration to 4.x steps to it, so I'm guessing it could be something I've missed when authoring for the wrong version of Netbox? I'm hoping someone will be able to give me some pointers on what to check or a direction. Thanks, NS |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, I've taken a look at your code and identified the likely reason for the missing tabs. In your Here's a good example from the NetBox ACL plugin that demonstrates that approach: Additionally, I suggest removing the You might also find the NetBox cookiecutter repository to be a helpful starting point for structuring your plugin: Alternatively, reviewing some existing and actively maintained plugins can offer useful guidance and best practices. Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hi,
I've taken a look at your code and identified the likely reason for the missing tabs. In your
urls.py
, it looks like the paths for the Journal and Contacts views are missing. To resolve this, I recommend switching from custom URL paths to using NetBox’s built-in view registration method.Here's a good example from the NetBox ACL plugin that demonstrates that approach:
netbox-community/netbox-acls#254
Additionally, I suggest removing the
setup.py
file and relying solely onpyproject.toml
. This is the modern standard and aligns with NetBox’s evolving packaging practices.You might also find the NetBox cookiecutter repository to be a helpful starting point for structuring your plugin:
ht…