-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
24 lines (20 loc) · 895 Bytes
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
app_name = 'onlinecourse'
urlpatterns = [
# route is a string contains a URL pattern
# view refers to the view function
# name the URL
path(route='', view=views.CourseListView.as_view(), name='index'),
path('registration/', views.registration_request, name='registration'),
path('login/', views.login_request, name='login'),
path('logout/', views.logout_request, name='logout'),
# ex: /onlinecourse/5/
path('<int:pk>/', views.CourseDetailView.as_view(), name='course_details'),
# ex: /enroll/5/
path('<int:course_id>/enroll/', views.enroll, name='enroll'),
# <HINT> Create a route for submit view
# <HINT> Create a route for show_exam_result view
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)