You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
4.1 KiB
76 lines
4.1 KiB
"""project URL Configuration
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
https://docs.djangoproject.com/en/2.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.contrib import admin
|
|
from django.urls import path, include
|
|
from django.views.generic import TemplateView
|
|
from django.conf import settings
|
|
|
|
from apps.course.views import (
|
|
CoursesView, likes, coursecomment,
|
|
CourseView, LessonView, SearchView,
|
|
lessoncomment, CourseEditView,
|
|
CourseOnModerationView,
|
|
)
|
|
from apps.user.views import (
|
|
UserView, UserEditView, NotificationEditView,
|
|
PaymentHistoryView, resend_email_verify,
|
|
)
|
|
from apps.payment.views import CourseBuyView, PaymentwallCallbackView, SchoolBuyView
|
|
|
|
from .views import IndexView
|
|
|
|
urlpatterns = [
|
|
path('admin/', admin.site.urls),
|
|
path('auth/', include(('apps.auth.urls', 'lilcity'))),
|
|
path('courses/', CoursesView.as_view(), name='courses'),
|
|
path('course/create', CourseEditView.as_view(), name='course_create'),
|
|
path('course/on-moderation', CourseOnModerationView.as_view(), name='course-on-moderation'),
|
|
path('course/<int:pk>/', CourseView.as_view(), name='course'),
|
|
path('course/<str:slug>/', CourseView.as_view(), name='course'),
|
|
path('course/<int:pk>/checkout', CourseBuyView.as_view(), name='course-checkout'),
|
|
path('course/<int:pk>/edit', CourseEditView.as_view(), name='course_edit'),
|
|
path('course/<int:pk>/lessons', CourseView.as_view(template_name='course/course_only_lessons.html', only_lessons=True), name='course-only-lessons'),
|
|
path('course/<int:course_id>/like', likes, name='likes'),
|
|
path('course/<int:course_id>/comment', coursecomment, name='coursecomment'),
|
|
path('lesson/<int:pk>/', LessonView.as_view(), name='lesson'),
|
|
path('lesson/<int:lesson_id>/comment', lessoncomment, name='lessoncomment'),
|
|
path('payments/ping', PaymentwallCallbackView.as_view(), name='payment-ping'),
|
|
path('paymentwall/pingback', PaymentwallCallbackView.as_view(), name='payment-ping-second'),
|
|
path('payments/success', TemplateView.as_view(template_name='payment/payment_success.html'), name='payment-success'),
|
|
path('payments/error', TemplateView.as_view(template_name='payment/payment_error.html'), name='payment-error'),
|
|
path('school/checkout', SchoolBuyView.as_view(), name='school-checkout'),
|
|
path('search/', SearchView.as_view(), name='search'),
|
|
path('user/<int:pk>/', UserView.as_view(), name='user'),
|
|
path('user/<int:pk>/edit', UserEditView.as_view(), name='user-edit-profile'),
|
|
path('user/<int:pk>/notifications', NotificationEditView.as_view(), name='user-edit-notifications'),
|
|
path('user/<int:pk>/payments', PaymentHistoryView.as_view(), name='user-edit-payments'),
|
|
path('user/resend-email-verify', resend_email_verify, name='resend-email-verify'),
|
|
path('privacy', TemplateView.as_view(template_name="templates/lilcity/privacy_policy.html"), name='privacy'),
|
|
path('terms', TemplateView.as_view(template_name="templates/lilcity/terms.html"), name='terms'),
|
|
path('refund-policy', TemplateView.as_view(template_name="templates/lilcity/refund_policy.html"), name='refund_policy'),
|
|
path('', IndexView.as_view(), name='index'),
|
|
path('api/v1/', include(('api.v1.urls', 'api_v1'))),
|
|
path('test', TemplateView.as_view(template_name="templates/lilcity/test.html"), name='test'),
|
|
]
|
|
|
|
|
|
if settings.DEBUG:
|
|
from django.conf.urls.static import static
|
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
|
|
|
urlpatterns += [path('silk/', include('silk.urls', namespace='silk'))]
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
urlpatterns += staticfiles_urlpatterns()
|
|
|