from django.urls.conf import path, include from books.views import BookDetailView, BookUpdateView, BooksListView, BooksListAPIView, \ CreateBookAPIView from comment.views import AddCommentAPIView app_name = "book" api_urlpatterns = ([ path(r'', BooksListAPIView.as_view(), name="all"), path(r'create/', CreateBookAPIView.as_view(), name="create"), ], 'api') urlpatterns = [ path('', BooksListView.as_view(), name='all'), path(r'api/', include(api_urlpatterns), name="api"), path('<int:book_pk>/', BookDetailView.as_view(), name='detail'), path('<int:book_pk>/edit/', BookUpdateView.as_view(), name='edit'), path('<int:book_pk>/comment/', AddCommentAPIView.as_view(), name='comment'), ]
from books import views as books_views # this is provided by django for login and logout from django.contrib.auth import views as auth_views # for adding the roots for media url from django.conf import settings from django.conf.urls.static import static from books.views import BookListView, BookDetailView, BookCreateView, BookUpdateView, BookDeleteView urlpatterns = [ path('admin/', admin.site.urls), path('', BookListView.as_view(), name='home'), path('book/<int:pk>', BookDetailView.as_view(), name='book-detail'), #path('book/<int:pk>', book_detail, name='book-detail'), path('book/<int:pk>/update', BookUpdateView.as_view(), name='book-update'), path('book/<int:pk>/delete', BookDeleteView.as_view(), name='book-delete'), path('book/new/', BookCreateView.as_view(), name='book-create'), #path('', user_views.home, name='home'), path('register/', user_views.register, name='register'), path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout'), path('profile/', user_views.profile, name='profile'), path('search/', books_views.search, name='search'), path('favorite/<int:pk>', books_views.favorite_book, name='favorite_book'), path('removefavorite/<int:pk>', books_views.remove_favorite_book,
from books.views import ( BookListView, BookDetailView, BookCreateView, BookUpdateView, BookDeleteView, SearchResultsView, ReviewCreateView, ReviewUpdateView, ReviewDeleteView, ) urlpatterns = [ path('', BookListView.as_view(), name='book_list'), path('<uuid:pk>/', BookDetailView.as_view(), name='book_detail'), path('create/', BookCreateView.as_view(), name='book_create'), path('<uuid:pk>/edit', BookUpdateView.as_view(), name='book_update_view'), path('<uuid:pk>/delete/', BookDeleteView.as_view(), name='book_delete_view'), path('search/', SearchResultsView.as_view(), name='search_results'), path('<uuid:pk>/review/', ReviewCreateView.as_view(), name='book_review'), path('<uuid:book_pk>/review/<uuid:pk>/update/', ReviewUpdateView.as_view(), name='book_review_edit'), path('<uuid:book_pk>/review/<uuid:pk>/delete/', ReviewDeleteView.as_view(), name='book_review_delete'), ]
1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.urls import path from books.views import ( BookCreateView, BookDeleteView, BookListView, BookSearchResultsImportView, BookSearchView, BookUpdateView, IndexView, RESTBookListView, ) urlpatterns = [ path("", IndexView.as_view(), name="index"), path("api/books/", RESTBookListView.as_view(), name="rest_book_list"), path("books/", BookListView.as_view(), name="book_list"), path("books/add/", BookCreateView.as_view(), name="book_create"), path("books/<pk>/update/", BookUpdateView.as_view(), name="book_update"), path("books/<pk>/delete/", BookDeleteView.as_view(), name="book_delete"), path("books/search/", BookSearchView.as_view(), name="book_search"), path( "books/search-result/<isbn>/add/", BookSearchResultsImportView.as_view(), name="book_search_results_import", ), ]
from django.urls import path from books.views import BookCreateView, BookListView, BookUpdateView, delete_book from categories.views import CategoriesListView, CategoryCreateView, CategoryUpdateView, category_delete urlpatterns = [ path('categories/', CategoriesListView.as_view()), path('categories/create/', CategoryCreateView.as_view()), path('categories/update/<int:pk>/', CategoryUpdateView.as_view()), path('categories/delete/<int:pk>/', category_delete), path('create/', BookCreateView.as_view()), path('update/<int:pk>/', BookUpdateView.as_view()), path('delete/<int:pk>/', delete_book), path('', BookListView.as_view()), ]
"""crudCBV URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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 books.views import BookListView, BookCreateView, BookDetailView, BookUpdateView, BookDeleteView urlpatterns = [ path('admin/', admin.site.urls), path('', BookListView.as_view(), name='home'), path('create/', BookCreateView.as_view(), name='create'), path('detail/<int:pk>', BookDetailView.as_view(), name='detail'), path('update/<int:pk>', BookUpdateView.as_view(), name='update'), path('delete/<int:pk>', BookDeleteView.as_view(), name='delete'), ]
from django.urls import path from books.views import (AuthorCreateView, AuthorDeleteView, AuthorListView, AuthorUpdateView, BookCreateView, BookDeleteView, BookDetailView, BookListView, BookListViewDF, BookUpdateView, GenreCreateView, GenreDeleteView, GenreListView, GenreUpdateView) urlpatterns = [ path("bookstore/books/", BookListView.as_view(), name="bookstore"), path("bookstore/book/add-book", BookCreateView.as_view(), name="book-add"), path("bookstore/book/<int:pk>/", BookDetailView.as_view(), name="book-details"), path("bookstore/book/<int:pk>/update/", BookUpdateView.as_view(), name="book-update"), path("bookstore/book/<int:pk>/delete/", BookDeleteView.as_view(), name="book-delete"), path("bookstore/author/create/", AuthorCreateView.as_view(), name="author-add"), path("bookstore/authors/", AuthorListView.as_view(), name="authors"), path( "bookstore/author/<int:pk>/update", AuthorUpdateView.as_view(), name="author-update", ), path( "bookstore/author/<int:pk>/delete",
from django.urls import path from books.views import ( BookListView, BookDetailView, BookCreateView, BookUpdateView, ) app_name = "books" urlpatterns = [ path("", BookListView.as_view(), name="books"), path("create", BookCreateView.as_view(), name="book_create"), path("update/<int:pk>", BookUpdateView.as_view(), name="book_update"), path("<int:pk>", BookDetailView.as_view(), name="book_detail"), ]
from django.urls import path from books.views import BookList, BookDetail, BookCreateView, BookUpdateView, BookDeleteView urlpatterns = [ path('', BookList.as_view(), name='book_list_view'), path('<int:pk>', BookDetail.as_view(), name='book_detail_view'), path('create/', BookCreateView.as_view(), name="book_create_view"), path('update/<int:pk>', BookUpdateView.as_view(), name="book_update_view"), path('delete/<int:pk>', BookDeleteView.as_view(), name='book_delete_view'), ]
# path('books', index, name='books.index'), # path('books/<int:pk>', show, name='books.show'), # path('books/<int:pk>/edit', edit, name='books.edit'), # path('books/create', create, name='books.create'), # path('books/search', search, name='books.search'), # ] from django.urls import path from django.views.generic import TemplateView from books.views import BooksListView, BookCreateView, BookDetailView, BookUpdateView, BookDeleteView, \ CartView urlpatterns = [ path('books/', BooksListView.as_view(), name='books.index'), path('books/<int:pk>', BookDetailView.as_view(), name='books.show'), path('books/<int:pk>/edit', BookUpdateView.as_view(), name='books.edit'), path('books/<int:pk>/delete', BookDeleteView.as_view(), name='books.delete'), path('books/create', BookCreateView.as_view(), name='books.create'), path('user-login/', TemplateView.as_view(template_name="UserLogin.html"), name="user_login"), path('seller-login/', TemplateView.as_view(template_name="SellerLogin.html"), name="seller_login"), path('contact/', TemplateView.as_view(template_name="ContactPage.html"), name="contact"), # path('search/', SearchResultsView.as_view(), name='search_results'), path('books/cart', CartView.as_view(), name='cart'),
path('update-series/<int:series_id>', book_view.book_update_series, name='update-series'), path('delete-series/<int:series_id>', book_view.book_delete_series, name='delete-series'), path('create-genre/', book_view.book_create_genre, name='create-genre'), path('update-genre/<int:genre_id>', book_view.book_update_genre, name='update-genre'), path('delete-genre/<int:genre_id>', book_view.book_delete_genre, name='delete-genre'), path('create-publisher/', book_view.book_create_publisher, name='create-publisher'), path('update-publisher/<int:publisher_id>', book_view.book_update_publisher, name='update-publisher'), path('delete-publisher/<int:publisher_id>', book_view.book_delete_publisher, name='delete-publisher'), path('', BookListView.as_view(), name='books-view'), path('authors-view/', AuthorListView.as_view(), name='authors-view'), path('book-view/<int:pk>/', BookDetailView.as_view(), name='book-view'), path('book-create-view/', BookCreateView.as_view(), name='book_create'), path('book-update/<int:pk>/', BookUpdateView.as_view(), name='book_update'), path('book-delete/<int:pk>/', BookDeleteView.as_view(), name='book_delete'), ]