mediacms/files/urls.py

92 lines
4.0 KiB
Python
Raw Normal View History

2020-12-15 22:33:43 +01:00
from django.conf import settings
from django.conf.urls import include, re_path
2021-05-26 17:35:21 +02:00
from django.conf.urls.static import static
2020-12-15 22:33:43 +01:00
from django.urls import path
2021-05-26 17:35:21 +02:00
from . import management_views, views
2020-12-24 23:49:38 +01:00
from .feeds import IndexRSSFeed, SearchRSSFeed
2020-12-15 22:33:43 +01:00
urlpatterns = [
re_path(r"^$", views.index),
re_path(r"^about", views.about, name="about"),
re_path(r"^add_subtitle", views.add_subtitle, name="add_subtitle"),
re_path(r"^categories$", views.categories, name="categories"),
re_path(r"^contact$", views.contact, name="contact"),
re_path(r"^edit", views.edit_media, name="edit_media"),
re_path(r"^embed", views.embed_media, name="get_embed"),
re_path(r"^featured$", views.featured_media),
re_path(r"^fu/", include(("uploader.urls", "uploader"), namespace="uploader")),
re_path(r"^history$", views.history, name="history"),
re_path(r"^liked$", views.liked_media, name="liked_media"),
re_path(r"^latest$", views.latest_media),
re_path(r"^members", views.members, name="members"),
re_path(
2020-12-15 22:33:43 +01:00
r"^playlist/(?P<friendly_token>[\w]*)$",
views.view_playlist,
name="get_playlist",
),
re_path(
2020-12-15 22:33:43 +01:00
r"^playlists/(?P<friendly_token>[\w]*)$",
views.view_playlist,
name="get_playlist",
),
re_path(r"^popular$", views.recommended_media),
re_path(r"^recommended$", views.recommended_media),
2020-12-24 23:49:38 +01:00
path("rss/", IndexRSSFeed()),
re_path("^rss/search", SearchRSSFeed()),
re_path(r"^search", views.search, name="search"),
re_path(r"^scpublisher", views.upload_media, name="upload_media"),
re_path(r"^tags", views.tags, name="tags"),
re_path(r"^tos$", views.tos, name="terms_of_service"),
re_path(r"^view", views.view_media, name="get_media"),
re_path(r"^upload", views.upload_media, name="upload_media"),
2020-12-15 22:33:43 +01:00
# API VIEWS
re_path(r"^api/v1/media$", views.MediaList.as_view()),
re_path(r"^api/v1/media/$", views.MediaList.as_view()),
re_path(
2020-12-15 22:33:43 +01:00
r"^api/v1/media/(?P<friendly_token>[\w]*)$",
views.MediaDetail.as_view(),
name="api_get_media",
),
re_path(
2020-12-15 22:33:43 +01:00
r"^api/v1/media/encoding/(?P<encoding_id>[\w]*)$",
views.EncodingDetail.as_view(),
name="api_get_encoding",
),
re_path(r"^api/v1/search$", views.MediaSearch.as_view()),
re_path(
2020-12-15 22:33:43 +01:00
r"^api/v1/media/(?P<friendly_token>[\w]*)/actions$",
views.MediaActions.as_view(),
),
re_path(r"^api/v1/categories$", views.CategoryList.as_view()),
re_path(r"^api/v1/tags$", views.TagList.as_view()),
re_path(r"^api/v1/comments$", views.CommentList.as_view()),
re_path(
2020-12-15 22:33:43 +01:00
r"^api/v1/media/(?P<friendly_token>[\w]*)/comments$",
views.CommentDetail.as_view(),
),
re_path(
2020-12-15 22:33:43 +01:00
r"^api/v1/media/(?P<friendly_token>[\w]*)/comments/(?P<uid>[\w-]*)$",
views.CommentDetail.as_view(),
),
re_path(r"^api/v1/playlists$", views.PlaylistList.as_view()),
re_path(r"^api/v1/playlists/$", views.PlaylistList.as_view()),
re_path(
2020-12-15 22:33:43 +01:00
r"^api/v1/playlists/(?P<friendly_token>[\w]*)$",
views.PlaylistDetail.as_view(),
name="api_get_playlist",
),
re_path(r"^api/v1/user/action/(?P<action>[\w]*)$", views.UserActions.as_view()),
2020-12-15 22:33:43 +01:00
# ADMIN VIEWS
re_path(r"^api/v1/encode_profiles/$", views.EncodeProfileList.as_view()),
re_path(r"^api/v1/manage_media$", management_views.MediaList.as_view()),
re_path(r"^api/v1/manage_comments$", management_views.CommentList.as_view()),
re_path(r"^api/v1/manage_users$", management_views.UserList.as_view()),
re_path(r"^api/v1/tasks$", views.TasksList.as_view()),
re_path(r"^api/v1/tasks/$", views.TasksList.as_view()),
re_path(r"^api/v1/tasks/(?P<friendly_token>[\w|\W]*)$", views.TaskDetail.as_view()),
re_path(r"^manage/comments$", views.manage_comments, name="manage_comments"),
re_path(r"^manage/media$", views.manage_media, name="manage_media"),
re_path(r"^manage/users$", views.manage_users, name="manage_users"),
2020-12-15 22:33:43 +01:00
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)