示例#1
0
      name="books-genre"),
 path("add_like_to_comment/<str:slug>/<int:id_comment>/<str:location>/",
      AddLike2Comment.as_view(),
      name="add-like-to-comment-location"),
 path("add_rate_to_book/<str:slug>/<int:rate>/",
      AddRate2Book.as_view(),
      name="add-rate"),
 path("add_rate_to_book/<str:slug>/<int:rate>/<str:location>/",
      AddRate2Book.as_view(),
      name="add-rate-location"),
 path("book_view_detail/<str:slug>/",
      BookDetail.as_view(),
      name="book-detail"),
 path("add-book/", AddBook.as_view(), name="add-book"),
 path("add-comment-location/<str:slug>/<str:location>/",
      AddComment.as_view(),
      name="add-comment-location"),
 path("login/", LoginView.as_view(), name="login"),
 path("register/", RegisterView.as_view(), name='register'),
 path("logout/", logout_user, name="logout"),
 path("delete_book/<str:slug>/", book_delete, name="delete-book"),
 path("update_book/<str:slug>/", UpdateBook.as_view(), name="update-book"),
 path("update_book_author/<str:slug>/",
      UpdateBookAuthor.as_view(),
      name="update-book-author"),
 path("delete_comment/<str:slug>/<int:id_comment>/",
      comment_delete,
      name="delete-comment"),
 path("update_comment/<str:slug>/<int:id_comment>/",
      UpdateComment.as_view(),
      name="update-comment"),
    logout_user, AddComment, book_delete, UpdateBook, comment_delete, UpdateComment, RegisterView

urlpatterns = [
    path('add_like_comment/<int:id>',
         AddCommentLike.as_view(),
         name="add-like-comment"),
    path('add_like_comment/<int:id>/<str:location>/',
         AddCommentLike.as_view(),
         name="add-like-comment-location"),
    path("add_rate_to_book/<str:slug>/<int:rate>/",
         AddRate2Book.as_view(),
         name="add-rate"),
    path("add_rate_to_book/<str:slug>/<int:rate>/<str:location>/",
         AddRate2Book.as_view(),
         name="add-rate-location"),
    path("book_view_detail/<str:slug>/",
         BookDetail.as_view(),
         name="book-detail"),
    path("add_book/", AddBook.as_view(), name="add-book"),
    path("add_comment/<str:slug>/", AddComment.as_view(), name="add-comment"),
    path("delete_book/<str:slug>/", book_delete, name="delete-book"),
    path("update_book/<str:slug>/", UpdateBook.as_view(), name="update-book"),
    path("delete_comment/<int:id>/", comment_delete, name="delete-comment"),
    path("update_comment/<int:id>/",
         UpdateComment.as_view(),
         name="update-comment"),
    path("login/", LoginView.as_view(), name="login"),
    path("register/", RegisterView.as_view(), name="register"),
    path("logout/", logout_user, name="logout"),
    path("", MyPage.as_view(), name="the-main-page"),
]
示例#3
0
from django.urls import path, include
from django.views.decorators.cache import cache_page
from manager.views import Shop, OpenBook, OpenComment, AddCommentLike, AddBookRating, \
    AddComment, Login, Logout, AddBook, delete_book, UpdateBook, UpdateComment, CreateUser

urlpatterns = [
    #path('', Shop.as_view(), name='index-page'),
    path('', cache_page(5)(Shop.as_view()), name='index-page'),
    path('book/<str:slug>/', OpenBook.as_view(), name='open-book'),
    path('commentary/<str:slug>/<int:id>/',
         AddCommentLike.as_view(),
         name='add-comment-like'),
    path('commentary/<str:slug>/', OpenComment.as_view(), name='open-comment'),
    path('add-rating/<str:slug>/<int:rating>',
         AddBookRating.as_view(),
         name='add-rating'),
    path('add-rating/<str:slug>/<int:rating>/<str:location>/',
         AddBookRating.as_view(),
         name='add-rating-location'),
    path('<str:slug>/add-comment/', AddComment.as_view(), name='add-comment'),
    path('login/', Login.as_view(), name='login'),
    path('register/', CreateUser.as_view(), name='register'),
    path('logout/', Logout.as_view(), name='logout'),
    path('add-book/', AddBook.as_view(), name='add-book'),
    path('delete-book/<str:slug>/', delete_book, name='delete-book'),
    path('update-book/<str:slug>/', UpdateBook.as_view(), name='update-book'),
    path('update-comment/<str:slug>/<int:id>',
         UpdateComment.as_view(),
         name='update-comment'),
]