urls.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. "<str:slug>/",
  20. views.GameDetail.as_view(),
  21. name="game_detail",
  22. ),
  23. path(
  24. "<str:slug>/play/",
  25. views.GamePlayDetail.as_view(),
  26. name="game_play_detail",
  27. ),
  28. path(
  29. "system/<str:slug>/",
  30. views.GameSystemDetail.as_view(),
  31. name="game_system_detail",
  32. ),
  33. path("genre/<str:slug>/", views.GenreDetail.as_view(), name="genre_detail"),
  34. path(
  35. "publisher/<str:slug>/",
  36. views.PublisherDetail.as_view(),
  37. name="publisher_detail",
  38. ),
  39. path(
  40. "developer/<str:slug>/",
  41. views.DeveloperDetail.as_view(),
  42. name="developer_detail",
  43. ),
  44. ]