Commit 57e444ee authored by Erlend Ydse's avatar Erlend Ydse
Browse files

Extract "api/" prefix to secfit.urls

parent 3d07781e
......@@ -3,6 +3,6 @@ from django.urls import path
from comments.views import CommentDetail, CommentList
urlpatterns = [
path("api/comments/", CommentList.as_view(), name="comment-list"),
path("api/comments/<int:pk>/", CommentDetail.as_view(), name="comment-detail"),
path("comments/", CommentList.as_view(), name="comment-list"),
path("comments/<int:pk>/", CommentDetail.as_view(), name="comment-detail"),
]
......@@ -23,9 +23,9 @@ from secfit import views
urlpatterns = [
path("admin/", admin.site.urls),
path("", views.api_root),
path("", include("workouts.urls")),
path("", include("users.urls")),
path("", include("comments.urls")),
path("api/", include("workouts.urls")),
path("api/", include("users.urls")),
path("api/", include("comments.urls")),
path("api/auth/", include("rest_framework.urls")),
path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
......
......@@ -3,18 +3,18 @@ from django.urls import path
from users import views
urlpatterns = [
path("api/users/", views.UserList.as_view(), name="user-list"),
path("api/users/<int:pk>/", views.UserDetail.as_view(), name="user-detail"),
path("api/users/<str:username>/", views.UserDetail.as_view(), name="user-detail"),
path("api/offers/", views.OfferList.as_view(), name="offer-list"),
path("api/offers/<int:pk>/", views.OfferDetail.as_view(), name="offer-detail"),
path("users/", views.UserList.as_view(), name="user-list"),
path("users/<int:pk>/", views.UserDetail.as_view(), name="user-detail"),
path("users/<str:username>/", views.UserDetail.as_view(), name="user-detail"),
path("offers/", views.OfferList.as_view(), name="offer-list"),
path("offers/<int:pk>/", views.OfferDetail.as_view(), name="offer-detail"),
path(
"api/athlete-files/", views.AthleteFileList.as_view(), name="athlete-file-list"
"athlete-files/", views.AthleteFileList.as_view(), name="athlete-file-list"
),
path(
"api/athlete-files/<int:pk>/",
"athlete-files/<int:pk>/",
views.AthleteFileDetail.as_view(),
name="athletefile-detail",
),
path("api/remember_me/", views.RememberMe.as_view(), name="remember_me"),
path("remember_me/", views.RememberMe.as_view(), name="remember_me"),
]
......@@ -7,35 +7,35 @@ from workouts import views
urlpatterns = format_suffix_patterns(
[
path("api/workouts/", views.WorkoutList.as_view(), name="workout-list"),
path("workouts/", views.WorkoutList.as_view(), name="workout-list"),
path(
"api/workouts/<int:pk>/",
"workouts/<int:pk>/",
views.WorkoutDetail.as_view(),
name="workout-detail",
),
path("api/exercises/", views.ExerciseList.as_view(), name="exercise-list"),
path("exercises/", views.ExerciseList.as_view(), name="exercise-list"),
path(
"api/exercises/<int:pk>/",
"exercises/<int:pk>/",
views.ExerciseDetail.as_view(),
name="exercise-detail",
),
path(
"api/exercise-instances/",
"exercise-instances/",
views.ExerciseInstanceList.as_view(),
name="exercise-instance-list",
),
path(
"api/exercise-instances/<int:pk>/",
"exercise-instances/<int:pk>/",
views.ExerciseInstanceDetail.as_view(),
name="exerciseinstance-detail",
),
path(
"api/workout-files/",
"workout-files/",
views.WorkoutFileList.as_view(),
name="workout-file-list",
),
path(
"api/workout-files/<int:pk>/",
"workout-files/<int:pk>/",
views.WorkoutFileDetail.as_view(),
name="workoutfile-detail",
),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment