from django.urls import include, path, re_path from post.views import ( PostCreateView, PostDetailView, PostDeleteView, PostListView, PostUpdateView, ) urlpatterns = [ re_path(r'^$', PostListView.as_view(), name="List"), re_path(r'^create', PostCreateView.as_view(), name="Create"), re_path(r'^detail/(?P<pk>[\d-]+)/$', PostDetailView.as_view(), name="Details"), re_path(r'update/(?P<pk>[\d-]_)/$', PostUpdateView.as_view(), name="Update"), re_path(r'^delete/(?P<pk>[\d]+)/$', PostDeleteView.as_view(), name="Delete") ]
from django.conf.urls import patterns, url from post.views import PostListView, PostDetailView, PostCreateView urlpatterns = patterns( 'post.views', url(r'^$', PostListView.as_view(), name='post-list'), url(r'^(?P<slug>[-_\w]+)/$', PostDetailView.as_view(), name='post-detail'), url(r'^add$', PostCreateView.as_view(), name='post-add'), )
from django.urls import path from post.views import PostListView, PostCreateView, PostDeleteView, PostUpdateView app_name = 'post' urlpatterns = [ path('postagens', PostListView.as_view(), name='listar_postagens'), path('criarpostagem', PostCreateView.as_view(), name='criar_postagem'), path('postagens/<int:pk>/apagar', PostDeleteView.as_view(), name='deletar_postagem'), path('postagens/<int:pk>/editar', PostUpdateView.as_view(), name='editar_postagem'), ]
urlpatterns = [ path('admin/', admin.site.urls), #path('', index), path('', IndexView.as_view(), name='home'), # path('blog/', post_list, name='post-list'), path('blog/', PostListView.as_view(), name='post-list'), path('search/', search, name='search'), path('about/', about, name='about'), path('service/', service, name='service'), path('email-signup/', email_list_signup, name='email-list-signup'), path('register/', v.register, name='register'), path('', include('sendemail.urls')), path('', include('django.contrib.auth.urls')), # path('create/', post_create, name='post-create'), path('create/', PostCreateView.as_view(), name='post-create'), # path('post/<id>/', post_detail, name='post-detail'), path('post/<pk>/', PostDetailView.as_view(), name='post-detail'), # path('post/<id>/update/', post_update, name='post-update'), path('post/<pk>/update/', PostUpdateView.as_view(), name='post-update'), # path('post/<id>/delete/', post_delete, name='post-delete'), path('post/<pk>/delete/', PostDeleteView.as_view(), name='post-delete'), path('tinymce/', include('tinymce.urls')), path('accounts/', include('allauth.urls')) ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url from post.views import (PostCreateView, PostDetailView, PostDeleteView, PostListView, PostUpdateView, AuthorPostView) app_name = 'post' urlpatterns = [ url(r'^$', PostListView.as_view(), name='List'), url(r'^create', PostCreateView.as_view(), name='Create'), url(r'^detail/(?P<pk>[\d-]+)/$', PostDetailView.as_view(), name='Details'), url(r'^update/(?P<pk>[\d-]+)/$', PostUpdateView.as_view(), name='Update'), url(r'^delete/(?P<pk>[\d-]+)/$', PostDeleteView.as_view(), name='Delete'), url(r'^author/(?P<username>[-\w]+)/$', AuthorPostView.as_view(), name='Author-Post') ]
from django.conf.urls import url from post.views import (PostsFavoriteAPIView, CommentCreateAPIView, CommentListAPIView, CommentSingleAPIView, CommentUpdateAPIView, CommentsDestroyAPIView, TagListAPIView, PostsFeedAPIView, PostCreateView, PostsUpvoteAPIView, PostsDownvoteAPIView, PostDisplayView, PostSingleView, PostUpdateView, PostDestroyAPIView) urlpatterns = [ url(r'^feed/?$', PostsFeedAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/favorite/?$', PostsFavoriteAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/upvote/?$', PostsUpvoteAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/downvote/?$', PostsDownvoteAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/comments/create/?$', CommentCreateAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/comments/view/?$', CommentListAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/comments/view/(?P<comment_pk>[\d]+)?$', CommentSingleAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/comments/update/(?P<comment_pk>[\d]+)/?$', CommentUpdateAPIView.as_view()), url(r'^(?P<post_slug>[-\w]+)/comments/delete/(?P<comment_pk>[\d]+)/?$', CommentsDestroyAPIView.as_view()), url(r'^tags/?$', TagListAPIView.as_view()), url(r'^create/$', PostCreateView.as_view()), url(r'^view/?$', PostDisplayView.as_view()), url(r'^view/(?P<post_slug>[-\w]+)/?$', PostSingleView.as_view()), url(r'^update/(?P<post_slug>[-\w]+)/?$', PostUpdateView.as_view()), url(r'^(?P<post_slug>[-\w]+)/delete/?$', PostDestroyAPIView.as_view()), ]
from search import views as s from django_private_chat import urls as django_private_chat_urls from django.conf.urls import url from chat import views as chat urlpatterns = [ path('admin/', admin.site.urls), path('', v.registration, name='register'), #path('',v.registration,name='register1'), # path('home/',post.home,name='home'), path('home/', PostView.as_view(), name='post-create'), path('post/<int:pk>/', PostDetailView.as_view(), name="post-detail"), path('post/new/', PostCreateView.as_view(), name="post-form"), path('post/<int:pk>/update/', PostUpdateView.as_view(), name="post-update"), path('post/<int:pk>/delete/', PostDeleteView.as_view(), name="post-delete"), #path('profile/',pr.ProfileUpdateView,name='profile'), # wrong way to import class this will genrate an error because we are importing class as a function path('', include("django.contrib.auth.urls")), path( 'profile_update/', pr.ProfileUpdateView.as_view(), name='phome' ), #always import class based view as it. other wise it will give error that one extra argument given path('profile/', pr.ProfileView.as_view(), name='prhome'), path('homefeed/', post.home, name='post'), # path('search/',s.search.as_view(),name='search'), path('search/', s.search, name='search'), # path('profile/<int:pk>/',ProfileViewSearch.as_view(),name='profileSearch'), # url(r'^', include('django_private_chat.urls')),
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/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.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include from post.views import PostListView, PostDetailView, PostCreateView, PostUpdateView urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('django.contrib.auth.urls')), path('', PostListView.as_view(), name='home'), path('<int:pk>/', PostDetailView.as_view(), name='post_detail'), path('new-post/', PostCreateView.as_view(), name='post_creation'), path('post/<int:pk>/', PostUpdateView.as_view(), name='post_update'), ] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.urls import path from post.views import PostDetailView, PostCreateView, PostUpdateView, PostLike, PostDeleteView app_name = "post" urlpatterns = [ path('<int:pk>', PostDetailView.as_view(), name='detail'), path('new', PostCreateView.as_view(), name='new'), path('<int:pk>/update', PostUpdateView.as_view(), name='update'), path('<int:pk>/delete', PostDeleteView.as_view(), name='delete'), path('api/like/', PostLike, name='postlike') ]
from django.urls import path from post.views import PostListView, PostCreateView, PostDeleteView, PostUpdateView app_name = 'post' urlpatterns = [ path('posts', PostListView.as_view(), name="listaposts"), path('criarposts', PostCreateView.as_view(), name="criarpost"), path('posts/<int:pk>/apagar', PostDeleteView.as_view(), name="deletarpost"), path('posts/<int:pk>/update', PostUpdateView.as_view(), name="updatepost") ]