Esempio n. 1
0
from django.contrib.auth.decorators import login_required
from django.urls import path

from courses.views import HomeView, AboutView, ContactView, CourseListView, CourseDetailView, LessonDetailView, \
    SearchView, krijo_klase, krijo_lende, krijo_mesim

app_name = 'courses'

urlpatterns = [
    path('', HomeView.as_view(), name='home'),
    path('about/', AboutView.as_view(), name='about'),
    path('contact/', ContactView.as_view(), name='contact'),
    path('courses/<int:category>', CourseListView, name='course_list'),
    path('courses/<slug>/',
         login_required(CourseDetailView.as_view()),
         name='course_detail'),
    path('courses/<course_slug>/<lesson_slug>/',
         login_required(LessonDetailView.as_view()),
         name='lesson_detail'),
    path('search/', SearchView, name='kerko_kurs'),
    path('krijo/klase', krijo_klase, name='krijo_klase'),
    path('krijo/lende', krijo_lende, name='krijo_lende'),
    path('krijo/mesim', krijo_mesim, name='krijo_mesim')
]
from django.urls import include, path

from . import views

from . import forms

from courses.views import AboutView, CourseList, CourseDetails, CreateCourseView, UpdateCourseView, DeleteCourseView

urlpatterns = [
    path('about', AboutView.as_view()),
    path('', CourseList.as_view(), name='courses-list'),
    path('home', views.home),
    path('<int:pk>/', views.detail),
    path('<int:course_id>/t<int:step_id>',
         views.text_detail,
         name='text_detail'),
    path('<int:course_id>/q<int:step_id>',
         views.quiz_detail,
         name='quiz_detail'),
    path('create', CreateCourseView.as_view(), name='courses-create'),
    path('update/<int:pk>/', UpdateCourseView.as_view(), name='courses-edit'),
    path('delete/<int:pk>/', DeleteCourseView.as_view(),
         name='courses-delete'),
    path('suggestion', views.suggestionView),
    path('<int:course_id>/create/quiz', views.quiz_create, name="create_quiz"),
    path('<int:course_id>/edit/quiz/<int:quiz_id>',
         views.quiz_edit,
         name="edit_quiz"),
]