urlpatterns = [ path('admin/', admin.site.urls), path('', TemplateView.as_view(template_name='base.html'), name='home'), path('new-user/', UserRegistrationView.as_view(), name='user_registration'), path('login/', LoginView.as_view(), {'template_name': 'login.>html'}, name='login'), path('logout/', LogoutView.as_view(), {'next_page': '/login/'}, name='logout'), path('blog/new/', NewBlogView.as_view(), name='new-blog'), path('blog/<int:pk>/update/', UpdateBlogView.as_view(), name='update-blog'), path('blog/post/new/', NewBlogPostView.as_view(), name='new-blog-post'), path('blog/post/<int:pk>/update/', UpdateBlogPostView.as_view(), name='update-blog-post'), path('blog/post/<int:pk>/', BlogPostDetailsView.as_view(), name='blog-post-details'), path('blog/post/<int:pk>/share/', SharePostWithBlog.as_view(), name='share-blog-post-with-blog'), path('blog/post/<int:pk>/share/to/<int:blog_pk>/', SharePostWithBlog.as_view(), name='share-post-with-blog'), path('blog/post/<int:pk>/stop/share/to/<int:block_pk>/', StopSharingPostWithBlog.as_view(), name='stop-sharing-post-with-blog'),
from blog.views import HomeView, UpdateBlogView, NewBlogPostView, UpdateBlogPostView, BlogPostDetailsView, SharePostWithBlog from blog.views import StopSharingPostWithBlog, ShareBlogPostView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', HomeView.as_view(), name='home'), url(r'^new-user/$', UserRegistrationView.as_view(), name='user_registration'), url(r'^login/$', login, {'template_name': 'login.html'}, name='login'), url(r'^logout/$', logout, {'next_page': '/login/'}, name='logout'), url(r'^blog/new/$', NewBlogView.as_view(), name='new-blog'), url(r'^blog/(?P<pk>\d+)/update/$', UpdateBlogView.as_view(), name='update-blog'), url(r'blog/post/new/$', NewBlogPostView.as_view(), name='new-blog-post'), url(r'blog/post/(?P<pk>\d+)/update/$', UpdateBlogPostView.as_view(), name='update-blog-post'), url(r'blog/post/(?P<pk>\d+)/$', BlogPostDetailsView.as_view(), name='blog-post-details'), url(r'blog/post/(?P<pk>\d+)/share/$', ShareBlogPostView.as_view(), name='share-blog-post-with-blog'), url(r'blog/post/(?P<post_pk>\d+)/share/to/(?P<blog_pk>\d+)/$', SharePostWithBlog.as_view(), name='share-post-with-blog'), url(r'blog/post/(?P<post_pk>\d+)/stop/share/to/(?P<blog_pk>\d+)/$', StopSharingPostWithBlog.as_view(), name='stop-sharing-post-with-blog'),
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin from blog.views import PostListView,PostDetailView,NewCommentView,NewBlogPostView,UpdateBlogPostView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', PostListView.as_view(), name='post-list'), url(r'post/(?P<pk>\d+)/$', PostDetailView.as_view(), name='post-details'), url(r'new-comment/$', NewCommentView.as_view(), name='new-comment'), url(r'post/new/$', NewBlogPostView.as_view(), name='new-blog-post'), url(r'post/(?P<pk>\d+)/update/$', UpdateBlogPostView.as_view(), name='update-blog-post'), ]