ChangelogView is not working when template located in subdir #11260

Closed
opened 2025-12-29 21:42:37 +01:00 by adam · 0 comments
Owner

Originally created by @PanKaker on GitHub (Jun 5, 2025).

Deployment Type

Self-hosted

NetBox Version

v.4.2.5

Python Version

3.12

Steps to Reproduce

Create a custom plugin - 'test_plugin'

  1. Create a template in folder: 'templates/test_plugin/feature_1/template.html
  2. Create a view with @register_model_view(models.feature1)
@register_model_view(models.feature1)
class Feature1View(generic.ObjectView):
    queryset = models.Feature1.objects.all()
    template_name = "test_plugin/feature1/template.html"
  1. create urls.py
path("feature1/", include(get_model_urls(app_name, "feature1", detail=False))),
path("feature1/<int:pk>/", include(get_model_urls(app_name, "feature1"))),
  1. Navigate to the object changelog
    URI - "plugins/test_plugin/feature1/2/changelog
Error: Template doesn't exist
'test_plugin/template.htm'

Expected Behavior

Changelog and Journal is working, template is located at the location specified in the Feature1View.

Observed Behavior

Error: Template doesn't
'test_plugin/template.htm'

Originally created by @PanKaker on GitHub (Jun 5, 2025). ### Deployment Type Self-hosted ### NetBox Version v.4.2.5 ### Python Version 3.12 ### Steps to Reproduce Create a custom plugin - 'test_plugin' 1) Create a template in folder: 'templates/test_plugin/feature_1/template.html 2) Create a view with @register_model_view(models.feature1) ``` @register_model_view(models.feature1) class Feature1View(generic.ObjectView): queryset = models.Feature1.objects.all() template_name = "test_plugin/feature1/template.html" ``` 3) create urls.py > path("feature1/", include(get_model_urls(app_name, "feature1", detail=False))), > path("feature1/<int:pk>/", include(get_model_urls(app_name, "feature1"))), 4) Navigate to the object changelog URI - "plugins/test_plugin/feature1/2/changelog ``` Error: Template doesn't exist 'test_plugin/template.htm' ``` ### Expected Behavior Changelog and Journal is working, template is located at the location specified in the Feature1View. ### Observed Behavior Error: Template doesn't 'test_plugin/template.htm'
adam added the netbox label 2025-12-29 21:42:37 +01:00
adam closed this issue 2025-12-29 21:42:37 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11260