Exemplo n.º 1
0
    post_create,
    # post_update,
    post_delete,
    IndexView,
    PostListView,
    PostDetailView,
    PostCreateView,
    PostUpdateView,
    PostDeleteView,
    CatDetailView,
    cat_detail)

urlpatterns = [
    path('admin/', admin.site.urls),
    # path('', index),
    path('', IndexView.as_view(), name='home'),
    # path('accounts/profile/', IndexView.as_view()),
    # path('blog/', post_list, name='post-list'),
    path('blog/', PostListView.as_view(), name='post-list'),
    path('search/', search, name='search'),
    path('email-signup/', email_list_signup, name='email-list-signup'),
    # path('create/', post_create, name='post-create'),
    path('create/',
         permission_required('post_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/',
         permission_required('post_update')(PostUpdateView.as_view()),
         name='post-update'),
Exemplo n.º 2
0
from django.contrib import admin
from django.urls import path
from posts.views import IndexView, CreatePostView
from . import views
from .views import IndexView, PostDetail

urlpatterns = [
    path('', IndexView.as_view(), name="index"),
    path('detail/<slug:slug>', views.PostDetail.as_view(), name="single"),
    path('category/<slug:slug>',
         views.CategoryDetail.as_view(),
         name="category-detail"),
    path('search/', views.SearchView.as_view(), name="search"),
    path('create/', CreatePostView.as_view(), name="createPost"),
    path('detail/<slug:slug>/update',
         views.UpdatePostView.as_view(),
         name="update"),
    path('detail/<slug:slug>/delete',
         views.PostdeleteView.as_view(),
         name="delete"),
]
Exemplo n.º 3
0
    PostUpdateView,
    PostDeleteView,
)
from marketing.views import email_list_signup

urlpatterns = [
    path("admin/", admin.site.urls),
    path("register/", users_views.register, name="register"),
    path('login/',
         auth_views.LoginView.as_view(template_name='users/login.html'),
         name='login'),
    path('logout/',
         auth_views.LogoutView.as_view(template_name='users/logout.html'),
         name='logout'),
    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("email-signup/", email_list_signup, name="email-list-signup"),
    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")),
]
Exemplo n.º 4
0
from posts.views import (
    AddCommentView,
    CreatePostView,
    FollowIndexView,
    GroupView,
    IndexView,
    PostDeleteView,
    PostUpdateView,
    PostView,
    ProfileFollowView,
    ProfileUnfollowView,
    ProfileView,
)

urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('group/<slug:slug>/', GroupView.as_view(), name='group_posts'),
    path('new/', CreatePostView.as_view(), name='new_post'),
    path('follow/', FollowIndexView.as_view(), name='follow_index'),
    path('<str:username>/follow/',
         ProfileFollowView.as_view(),
         name='profile_follow'),
    path('<str:username>/unfollow/',
         ProfileUnfollowView.as_view(),
         name='profile_unfollow'),
    path('<str:username>/', ProfileView.as_view(), name='profile'),
    path('<str:username>/<int:post_id>/', PostView.as_view(), name='post'),
    path('<str:username>/<int:post_id>/edit/',
         PostUpdateView.as_view(),
         name='post_edit'),
    path('<str:username>/<int:post_id>/delete/',
Exemplo n.º 5
0
Arquivo: urls.py Projeto: Koi7/syp
    https://docs.djangoproject.com/en/1.10/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. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from posts.views import IndexView, About, Contacts, logout_view, LoginView, Ban
from syp import settings

urlpatterns = [
    url(ur'^$', IndexView.as_view(), name='index'),
    url(ur'^вход', LoginView.as_view(), name='login'),
    url(ur'^па/', admin.site.urls),
    url(ur'^посты/', include('posts.urls')),
    url(ur'^бан', Ban.as_view(), name='ban'),
    url(ur'^выход', logout_view, name='logout_view'),
    url(ur'^проект', About.as_view(), name='about'),
    url(ur'^контакты', Contacts.as_view(), name='contacts'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

handler404 = 'posts.views.not_found'
Exemplo n.º 6
0
from django.conf.urls import url, include
from django.contrib import admin
from user_auth.views import UserCreateView
from posts.views import IndexView, SubredditListView, PostCreateView, SubredditDetailView, \
                        PostDetailView, PostVoteView
from comments.views import CommentCreateView, CommentVoteView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include("django.contrib.auth.urls")),
    url(r'^create/user$', UserCreateView.as_view(), name="user_create_view"),
    url(r'^$', IndexView.as_view(), name="index_view"),
    url(r'^subreddits/$',
        SubredditListView.as_view(),
        name="subreddit_list_view"),
    url(r'^subreddit/(?P<pk>\d+)/$',
        SubredditDetailView.as_view(),
        name="subreddit_detail_view"),
    url(r'^subreddit/(?P<pk>\d+)/post/create/$',
        PostCreateView.as_view(),
        name='post_create_view'),
    url(r'^post/(?P<pk>\d+)/$',
        PostDetailView.as_view(),
        name='post_detail_view'),
    url(r'^post/(?P<pk>\d+)/upvote/$',
        PostVoteView.as_view(),
        name='post_upvote_view'),
    url(r'^post/(?P<pk>\d+)/downvote/$',
        PostVoteView.as_view(),
        name='post_downvote_view'),
    url(r'^post/(?P<pk>\d+)/comment/$',