from django.conf.urls import url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from blog.views import IndexView, ArticleDetailView, CategoryView, CommentCreateView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^comment/create/$', CommentCreateView.as_view(), name="comment-create"), url(r'^categorie/(?P<slug>[-\w]+)/$', CategoryView.as_view(), name='category'), url(r'^article/(?P<slug>[-\w]+)/$', ArticleDetailView.as_view(), name='article-detail'), url(r'^$', IndexView.as_view(), name="index"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path from blog.views import (ArticleListView, ArticleDetailView, ArticleLikeCreateView, CommentsView, CommentEditView, CommentCreateView, CommentDelete, CommentLikeCreateView, LikesView) app_name = "blog" urlpatterns = [ path('', ArticleListView.as_view(), name='index'), path('<int:pk>/', ArticleDetailView.as_view(), name='detail'), path('<int:pk>/comments/', CommentsView.as_view(), name='comments_get'), path('<int:pk>/likes/', LikesView.as_view(), name='likes_get'), path('comments/add/', CommentCreateView.as_view(), name='comment_add'), path('comments/<int:pk>/edit/', CommentEditView.as_view(), name='comment_edit'), path('comments/delete/', CommentDelete.as_view(), name='comment_delete'), path('likes/articles/add/', ArticleLikeCreateView.as_view(), name='like_article_add'), path('likes/comments/add/', CommentLikeCreateView.as_view(), name='like_comment_add'), ]