Files
mediacms/users/urls.py
T

44 lines
1.6 KiB
Python
Raw Normal View History

from django.urls import path, re_path
2021-05-26 18:35:21 +03:00
2020-12-15 23:33:43 +02:00
from . import views
urlpatterns = [
2021-08-05 13:25:25 +03:00
re_path(r"^user/(?P<username>[\w@._-]*)$", views.view_user, name="get_user"),
re_path(r"^user/(?P<username>[\w@._-]*)/$", views.view_user, name="get_user"),
2025-08-07 13:21:12 +03:00
re_path(r"^user/(?P<username>[\w@._-]*)/shared_with_me", views.shared_with_me, name="shared_with_me"),
re_path(r"^user/(?P<username>[\w@._-]*)/shared_by_me", views.shared_by_me, name="shared_by_me"),
2021-08-05 13:25:25 +03:00
re_path(
2020-12-15 23:33:43 +02:00
r"^user/(?P<username>[\w@.]*)/playlists$",
views.view_user_playlists,
name="get_user_playlists",
),
2021-08-05 13:25:25 +03:00
re_path(
2020-12-15 23:33:43 +02:00
r"^user/(?P<username>[\w@.]*)/about$",
views.view_user_about,
name="get_user_about",
),
2025-08-07 13:21:12 +03:00
re_path(r"^user/(?P<username>[\w@._-]*)/edit$", views.edit_user, name="edit_user"),
2021-08-05 13:25:25 +03:00
re_path(r"^channel/(?P<friendly_token>[\w]*)$", views.view_channel, name="view_channel"),
re_path(
2020-12-15 23:33:43 +02:00
r"^channel/(?P<friendly_token>[\w]*)/edit$",
views.edit_channel,
name="edit_channel",
),
# API VIEWS
2021-08-05 13:25:25 +03:00
path('api/v1/whoami', views.UserWhoami.as_view(), name='user-whoami'),
path('api/v1/user/token', views.UserToken.as_view(), name='user-token'),
path('api/v1/login', views.LoginView.as_view(), name='user-login'),
re_path(r"^api/v1/users$", views.UserList.as_view(), name="api_users"),
re_path(r"^api/v1/users/$", views.UserList.as_view()),
re_path(
2020-12-15 23:33:43 +02:00
r"^api/v1/users/(?P<username>[\w@._-]*)$",
views.UserDetail.as_view(),
name="api_get_user",
),
2021-08-05 13:25:25 +03:00
re_path(
2020-12-15 23:33:43 +02:00
r"^api/v1/users/(?P<username>[\w@._-]*)/contact",
views.contact_user,
name="api_contact_user",
),
]