-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates init and urls to handle docs page link activation. (#120)
- Loading branch information
Showing
3 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |