urls.py 701 B

1234567891011121314151617181920
  1. from django.urls import path, include
  2. from rest_framework_nested import routers
  3. from glitchtip.routers import BulkSimpleRouter
  4. from user_reports.views import UserReportViewSet
  5. from .views import IssueViewSet, EventViewSet
  6. router = BulkSimpleRouter()
  7. router.register(r"issues", IssueViewSet)
  8. issues_router = routers.NestedSimpleRouter(router, r"issues", lookup="issue")
  9. issues_router.register(r"events", EventViewSet, basename="issue-events")
  10. issues_router.register(
  11. r"user-reports", UserReportViewSet, basename="issue-user-reports"
  12. )
  13. # The API URLs are now determined automatically by the router.
  14. urlpatterns = [
  15. path("", include(router.urls)),
  16. path("", include(issues_router.urls)),
  17. ]