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 ...@@ -3,6 +3,6 @@ from django.urls import path
from comments.views import CommentDetail, CommentList from comments.views import CommentDetail, CommentList
urlpatterns = [ urlpatterns = [
path("api/comments/", CommentList.as_view(), name="comment-list"), path("comments/", CommentList.as_view(), name="comment-list"),
path("api/comments/<int:pk>/", CommentDetail.as_view(), name="comment-detail"), path("comments/<int:pk>/", CommentDetail.as_view(), name="comment-detail"),
] ]
...@@ -23,9 +23,9 @@ from secfit import views ...@@ -23,9 +23,9 @@ from secfit import views
urlpatterns = [ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("", views.api_root), path("", views.api_root),
path("", include("workouts.urls")), path("api/", include("workouts.urls")),
path("", include("users.urls")), path("api/", include("users.urls")),
path("", include("comments.urls")), path("api/", include("comments.urls")),
path("api/auth/", include("rest_framework.urls")), path("api/auth/", include("rest_framework.urls")),
path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"), path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"), path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
......
...@@ -3,18 +3,18 @@ from django.urls import path ...@@ -3,18 +3,18 @@ from django.urls import path
from users import views from users import views
urlpatterns = [ urlpatterns = [
path("api/users/", views.UserList.as_view(), name="user-list"), path("users/", views.UserList.as_view(), name="user-list"),
path("api/users/<int:pk>/", views.UserDetail.as_view(), name="user-detail"), path("users/<int:pk>/", views.UserDetail.as_view(), name="user-detail"),
path("api/users/<str:username>/", views.UserDetail.as_view(), name="user-detail"), path("users/<str:username>/", views.UserDetail.as_view(), name="user-detail"),
path("api/offers/", views.OfferList.as_view(), name="offer-list"), path("offers/", views.OfferList.as_view(), name="offer-list"),
path("api/offers/<int:pk>/", views.OfferDetail.as_view(), name="offer-detail"), path("offers/<int:pk>/", views.OfferDetail.as_view(), name="offer-detail"),
path( path(
"api/athlete-files/", views.AthleteFileList.as_view(), name="athlete-file-list" "athlete-files/", views.AthleteFileList.as_view(), name="athlete-file-list"
), ),
path( path(
"api/athlete-files/<int:pk>/", "athlete-files/<int:pk>/",
views.AthleteFileDetail.as_view(), views.AthleteFileDetail.as_view(),
name="athletefile-detail", 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 ...@@ -7,35 +7,35 @@ from workouts import views
urlpatterns = format_suffix_patterns( urlpatterns = format_suffix_patterns(
[ [
path("api/workouts/", views.WorkoutList.as_view(), name="workout-list"), path("workouts/", views.WorkoutList.as_view(), name="workout-list"),
path( path(
"api/workouts/<int:pk>/", "workouts/<int:pk>/",
views.WorkoutDetail.as_view(), views.WorkoutDetail.as_view(),
name="workout-detail", name="workout-detail",
), ),
path("api/exercises/", views.ExerciseList.as_view(), name="exercise-list"), path("exercises/", views.ExerciseList.as_view(), name="exercise-list"),
path( path(
"api/exercises/<int:pk>/", "exercises/<int:pk>/",
views.ExerciseDetail.as_view(), views.ExerciseDetail.as_view(),
name="exercise-detail", name="exercise-detail",
), ),
path( path(
"api/exercise-instances/", "exercise-instances/",
views.ExerciseInstanceList.as_view(), views.ExerciseInstanceList.as_view(),
name="exercise-instance-list", name="exercise-instance-list",
), ),
path( path(
"api/exercise-instances/<int:pk>/", "exercise-instances/<int:pk>/",
views.ExerciseInstanceDetail.as_view(), views.ExerciseInstanceDetail.as_view(),
name="exerciseinstance-detail", name="exerciseinstance-detail",
), ),
path( path(
"api/workout-files/", "workout-files/",
views.WorkoutFileList.as_view(), views.WorkoutFileList.as_view(),
name="workout-file-list", name="workout-file-list",
), ),
path( path(
"api/workout-files/<int:pk>/", "workout-files/<int:pk>/",
views.WorkoutFileDetail.as_view(), views.WorkoutFileDetail.as_view(),
name="workoutfile-detail", 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