urls.py 978 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from django.urls import include, path
  2. from games.api.views import GameViewSet
  3. from rest_framework import routers
  4. # importing views from views..py
  5. import games.views as views
  6. app_name = "games"
  7. urlpatterns = [
  8. path(
  9. "",
  10. views.GameList.as_view(),
  11. name="game_list",
  12. ),
  13. path(
  14. "<str:slug>/",
  15. views.GameDetail.as_view(),
  16. name="game_detail",
  17. ),
  18. path(
  19. "<str:slug>/play/",
  20. views.GamePlayDetail.as_view(),
  21. name="game_play_detail",
  22. ),
  23. path(
  24. "system/<str:slug>/",
  25. views.GameSystemDetail.as_view(),
  26. name="game_system_detail",
  27. ),
  28. path("genre/<str:slug>/", views.GenreDetail.as_view(), name="genre_detail"),
  29. path(
  30. "publisher/<str:slug>/",
  31. views.PublisherDetail.as_view(),
  32. name="publisher_detail",
  33. ),
  34. path(
  35. "developer/<str:slug>/",
  36. views.DeveloperDetail.as_view(),
  37. name="developer_detail",
  38. ),
  39. ]