from django.urls import path from backend.views import UserView, LogIn, AccountInfo, SendConfirmCode, ConfirmEmail, AccountContacts, \ CategoryView, ProductView, PartnerView, PartnerInfo, ParthnerProducts, UserCart, OrderView urlpatterns = [ path('registration/', UserView.as_view()), path('sendToken/', SendConfirmCode.as_view()), path('confirmation/', ConfirmEmail.as_view()), path('login/', LogIn.as_view()), path('info/', AccountInfo.as_view()), path('contact/', AccountContacts.as_view()), path('categories/', CategoryView.as_view()), path('products/', ProductView.as_view()), path('partner/', PartnerView.as_view()), path('partner_info/', PartnerInfo.as_view()), path('partner_products/', ParthnerProducts.as_view()), path('cart/', UserCart.as_view()), path('order/', OrderView.as_view()), ]
ListProject, UserView, BookmarkView, ContributionView, NotificationView, SignOutView, ) urls = [ path("", GithubOAuth.as_view(), name="GithubOAuth"), path("test-endpoint", TestEndPoint.as_view(), name="TestEndPoint"), path("page-validation", PageValidation.as_view(), name="PageValidation"), path("search-page", SearchPage.as_view(), name="SearchPage"), path( "fetch-project-list", GithubRepositoryList.as_view(), name="GithubRepositoryList", ), path("project", ProjectView.as_view(), name="ProjectView"), path("list-project", ListProject.as_view(), name="ListProject"), path("user-view", UserView.as_view(), name="UserView"), path("bookmark-view", BookmarkView.as_view(), name="BookmarkView"), path("contribution-view", ContributionView.as_view(), name="ContributionView"), path("notification-view", NotificationView.as_view(), name="NotificationView"), path("signout", SignOutView.as_view(), name="SignOutView"), ]
from django.urls import path from backend.views import DepartmentsView, DepartmentView, QuestionView, QuestionsView, QuizView, QuizzesView, UsersView, UserView urlpatterns = [ # User related URLS path("users/", UsersView.as_view()), path("users/<str:pk>", UserView.as_view()), # Department related URLS path("departments/", DepartmentsView.as_view()), path("department/<str:pk>", DepartmentView.as_view()), # Quiz related URLS path("quizzes/", QuizzesView.as_view()), path("quiz/<str:pk>", QuizView.as_view()), path("questions/", QuestionsView.as_view()), path("question/<str:pk>", QuestionView.as_view()), ]
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 from django.views.generic import TemplateView from django.conf import settings from django.conf.urls.static import static from backend.views import AuthenticateView from backend.views import UserView from backend.views import ResultsView from backend.views import UploadView urlpatterns = [ path('admin/', admin.site.urls), path('', TemplateView.as_view(template_name='backend/index.html')), path('api/authenticate', AuthenticateView.as_view()), path('api/users', UserView.as_view()), path('api/calculate', ResultsView.as_view()), path('api/upload', UploadView.as_view()) ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
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 rest_framework_swagger.views import get_swagger_view from django.conf.urls import url from backend.views import AlbumViewSet, UserView from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'albums', AlbumViewSet, basename='album') schema_view = get_swagger_view(title='Beautiful REST API') api_urlpatterns = [path('accounts/', include('rest_registration.api.urls'))] urlpatterns = [ path('', TemplateView.as_view(template_name='frontend/index.html')), url(r'^api/v1/$', schema_view), path('admin/', admin.site.urls), path('front/', include('frontend.urls')), path('api/v1/', include(api_urlpatterns)), url('^api/v1/user$', UserView.as_view()), path('api/v1/', include(router.urls)) ]