M1-SR-SOME/TouYube/configuration/urls.py

41 lines
1.8 KiB
Python

"""
URL configuration for configuration project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
import apps.TouYube.views
from configuration import settings
urlpatterns = [
path('', apps.TouYube.views.view_homepage, name="homepage"),
path('login/', apps.TouYube.views.view_login, name="login"),
path('logout/', apps.TouYube.views.view_logout, name="logout"),
path('video/upload/', apps.TouYube.views.view_video_upload, name="video_upload"),
path('video/delete/<uuid:video_id>/', apps.TouYube.views.view_video_delete, name="video_delete"),
path('video/view/<uuid:video_id>/', apps.TouYube.views.view_video_full, name="video_full"),
path('video/embed/<uuid:video_id>/', apps.TouYube.views.view_video_embed, name="video_embed"),
# TODO(Faraphel): find a better path and names for an example
path('callback/', apps.TouYube.views.view_attack_some, name="callback_attack_some"),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)