urls.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.RecentGameList.as_view(),
  11. name="game_list",
  12. ),
  13. path(
  14. "library/",
  15. views.LibraryGameList.as_view(),
  16. name="game_library_list",
  17. ),
  18. path(
  19. "publisher/",
  20. views.PublisherList.as_view(),
  21. name="publisher_list",
  22. ),
  23. path(
  24. "genre/",
  25. views.GenreList.as_view(),
  26. name="genre_list",
  27. ),
  28. path(
  29. "developer/",
  30. views.DeveloperList.as_view(),
  31. name="developer_list",
  32. ),
  33. path(
  34. "<str:slug>/",
  35. views.GameDetail.as_view(),
  36. name="game_detail",
  37. ),
  38. path(
  39. "<str:slug>/play/",
  40. views.GamePlayDetail.as_view(),
  41. name="game_play_detail",
  42. ),
  43. path(
  44. "system/<str:slug>/",
  45. views.GameSystemDetail.as_view(),
  46. name="game_system_detail",
  47. ),
  48. path(
  49. "genre/<str:slug>/",
  50. views.GenreDetail.as_view(),
  51. name="genre_detail",
  52. ),
  53. path(
  54. "publisher/<str:slug>/",
  55. views.PublisherDetail.as_view(),
  56. name="publisher_detail",
  57. ),
  58. path(
  59. "developer/<str:slug>/",
  60. views.DeveloperDetail.as_view(),
  61. name="developer_detail",
  62. ),
  63. ]