Skip to content

Commit

Permalink
Updates init and urls to handle docs page link activation. (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanderaa authored Oct 1, 2024
1 parent 3f0a78c commit c5c93f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/118.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated docs build to activate the link on the Installed Apps page.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class {{ cookiecutter.camel_name }}Config(NautobotAppConfig):
max_version = "{{ cookiecutter.max_nautobot_version }}"
default_settings = {}
caching_config = {}
docs_view_name = "plugins:{{ cookiecutter.app_name }}:docs"


config = {{ cookiecutter.camel_name }}Config # pylint:disable=invalid-name
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
"""Django urlpatterns declaration for {{ cookiecutter.app_name }} app."""

from django.templatetags.static import static
from django.urls import path
from django.views.generic import RedirectView
from nautobot.apps.urls import NautobotUIViewSetRouter

from {{ cookiecutter.app_name }} import views

router = NautobotUIViewSetRouter()
router.register("{{ cookiecutter.model_class_name | lower }}", views.{{ cookiecutter.model_class_name }}UIViewSet)

urlpatterns = router.urls
urlpatterns = [
path("docs/", RedirectView.as_view(url=static("{{ cookiecutter.app_name }}/docs/index.html")), name="docs"),
]

urlpatterns += router.urls

0 comments on commit c5c93f2

Please sign in to comment.