-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
18 lines (17 loc) · 1020 Bytes
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from django.urls import path
from .views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, UserPostListView
from . import views
urlpatterns = [
path('', PostListView.as_view(), name='blog-home'),
path('user/<str:username>', UserPostListView.as_view(), name='user-posts'),
path('post/<int:pk>/', PostDetailView.as_view(), name='post-detail'),
path('post/new/', PostCreateView.as_view(), name='post-create'),
path('post/<int:pk>/update/', PostUpdateView.as_view(), name='post-update'),
path('post/<int:pk>/delete/', PostDeleteView.as_view(), name='post-delete'),
path('about/', views.about, name='blog-about'),
path('post/<int:pk>/comment/', views.add_comment_to_post, name='add_comment_to_post'),
path('like/', views.like_post, name="like_post"),
path('vote/', views.vote_comment, name="vote_comment"),
path('autocomplete/', views.autocomplete, name="ajax_autocomplete"),
path('search/', views.search_blogpost, name="search_blogpost")
]