Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make urls.py a file that is always baked #198

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

smk4664
Copy link
Contributor

@smk4664 smk4664 commented Nov 19, 2024

Closes #196

Post Bake of urls.py with model_class_name==None:

"""Django urlpatterns declaration for test_app app."""

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


# Uncomment the following line if you have views to import
# from test_app import views


router = NautobotUIViewSetRouter()

# Here is an example of how to register a viewset, you will want to replace views.TestAppUIViewSet with your viewset
# router.register("test_app", views.TestAppUIViewSet)


urlpatterns = [
    path("docs/", RedirectView.as_view(url=static("test_app/docs/index.html")), name="docs"),
]

urlpatterns += router.urls

DRF does not complain when providing a router with no viewsets.

image

@smk4664 smk4664 self-assigned this Nov 19, 2024
@smk4664 smk4664 merged commit e9b4d0c into develop Nov 21, 2024
2 checks passed
@smk4664 smk4664 deleted the u/smk4664-keep-urls branch November 21, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

urls.py should not be deleted on post-gen hook
2 participants