예제 #1
0
파일: urls.py 프로젝트: tezp/django-blog
from django.urls import path

from blog.views import PostUpdateView, PostDeleteView
from .views import PostListView, PostDetailView, PostCreateView
from .views import home, about

urlpatterns = [
    # path('', home, name='home'),
    path('', PostListView.as_view(), name='home'),
    path('about', about, name='about'),
    path('posts/<int:pk>', PostDetailView.as_view(), name='post-detail'),
    path('posts/create', PostCreateView.as_view(), name='post-create'),
    path('posts/<int:pk>/update', PostUpdateView.as_view(),
         name='post-update'),
    path('posts/<int:pk>/delete', PostDeleteView.as_view(),
         name='post-delete'),
]
 def test_Post_Update_url_is_resolved(self):
     url = reverse('post-update', args=['2'])
     self.assertEquals(
         resolve(url).func.__name__,
         PostUpdateView.as_view().__name__)
예제 #3
0
from blog.views import (
    PostListView,
    PostDeleteView,
    PostDetailView,
    PostUpdateView,
    DraftListView,
    CreatePostView,
    comment_remove,
    post_publish,
    NewCuisineView,
    NewRestaurantView,
)
# CommentFormView,add_comment_to_post,comment_approve,)

# path('commentform/', CommentFormView.as_view(), name='comment_form'),
# path('post/<int:pk>/comment',add_comment_to_post , name='add_comment_to_post'),
# path('comment/<int:pk>/approve/',comment_approve, name='comment_approve'),
urlpatterns = [
    path('', PostListView.as_view(), name='post_list'),
    path('post/<int:pk>/', PostDetailView.as_view(), name='post_detail'),
    path('drafts/', DraftListView.as_view(), name='post_draft_list'),
    path('post/new/', CreatePostView.as_view(), name='post_new'),
    path('post/<int:pk>/edit/', PostUpdateView.as_view(), name='post_edit'),
    path('post/<int:pk>/remove/', PostDeleteView.as_view(),
         name='post_remove'),
    path('post/<int:pk>/publish/', post_publish, name='post_publish'),
    path('comment/<int:pk>/remove/', comment_remove, name='comment_remove'),
    path('newcuisine/', NewCuisineView.as_view(), name='new_cuisine'),
    path('newrestaurant/', NewRestaurantView.as_view(), name='new_restaurant'),
]
예제 #4
0
from django.urls import path
from blog.views import PostListView, PostDetailView, contact_us_form_view, PostCreateView, PostUpdateView, PostDeleteView, profileDetailView, BookmarkView, CommentDeleteView, bookmarkDeleteView, PostSearchListView

urlpatterns = [
    path('', PostListView.as_view(), name='home'),
    # path('blog', blogList),
    path('blogs/<slug:slug>', PostDetailView.as_view(), name='post-detail'),
    path('contactUs/', contact_us_form_view, name='contactUs'),
    path('category/<int:id>/', PostListView.as_view(),
         name='post_by_category'),
    path('post/', PostCreateView.as_view(), name='post'),
    path('update/<slug:slug>/', PostUpdateView.as_view(), name='update'),
    path('delete/<slug:slug>/', PostDeleteView.as_view(), name='delete'),
    path('<int:pk>/', profileDetailView.as_view(), name='profile'),
    path('search/', PostSearchListView.as_view(), name='search'),
    path('blog/bookmark', BookmarkView.as_view(), name='bookmark'),
    path('blog/<int:pk>/add_bookmark',
         BookmarkView.as_view(),
         name='add-bookmark'),
    path('comment/<int:id>/', CommentDeleteView, name='commentDelete'),
    path('bookmark/<int:id>/', bookmarkDeleteView, name='bookmarkDelete')
]
예제 #5
0
파일: urls.py 프로젝트: major96/Blog
"""myproject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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.contrib import admin
from django.conf.urls import url
from django.urls import path
from blog.views import CreatePostView, PostListView, PostDetailView, PostUpdateView, PostDeleteView

urlpatterns = [
    path('admin/', admin.site.urls),
    url('^$', PostListView.as_view(), name='post-list'),
    url('^create/$', CreatePostView.as_view(), name='post-create'),
    url('^(?P<pk>\d+)/$', PostDetailView.as_view(), name='post-detail'),
    url('^update/(?P<pk>\d+)/$', PostUpdateView.as_view(), name='post-update'),
    url('^delete/(?P<pk>\d+)/$', PostDeleteView.as_view(), name='post-delete'),
]
예제 #6
0
from django.urls import path, include
from blog.views import index, post_details, contact_us_form_view, register_form_view, post_form_view, post_update_form_view
from blog.views import HomeView, PostView, PostCreateView, PostListView, PostDetailView, AboutUs, PostUpdateView
urlpatterns = [
    path('', PostListView.as_view(), name="home"),
    # path('blogs/<slug:slug>',RedirectPost.as_view()),
    path('blogs/<slug:slug>', PostDetailView.as_view(), name="post-detail"),
    path('contact', contact_us_form_view),
    # path('register',register_form_view),
    path('post', PostCreateView.as_view()),
    path('post/<slug:slug>', PostUpdateView.as_view(), name="post-update"),
    path('post/<int:id>', post_update_form_view),
    path('about-us', AboutUs.as_view()),
]
예제 #7
0
from django.urls import path
from blog import views
from blog.views import PostListView, PostDeleteView, UserPostListView, PostCreateView, PostUpdateView
#PostDetailView
app_name = 'blog'

urlpatterns = [
    path('', PostListView.as_view(), name='blogHome'),
    path('posts/<username>/', UserPostListView.as_view(), name='user_posts'),
    path('<int:pk>/', views.blogPost, name='blogPost'),
    path('profile/', views.profile, name='profile'),
    path('new/', PostCreateView.as_view(), name='new'),
    path('post_update/<int:pk>/', PostUpdateView.as_view(), name="post_update"),
    path('delete/<int:pk>/', PostDeleteView.as_view(), name='delete'),
    path('comment/<int:sno>/', views.comment, name="comment")
]

# Class Based Views Look ForThe Below Template By Default:
# <appname>/<model>_<viewtype>.html
# path('<int:pk>/', PostDetailView.as_view(), name='blogPost')
# path('new/', views.new, name='new')
# path('post_update/<int:sno>/', views.post_update, name="post_update")
예제 #8
0
파일: urls.py 프로젝트: schir2/hangboard
from django.urls import path

from blog.views import PostDetailView
from blog.views import PostListView
from blog.views import PostCreateView
from blog.views import PostUpdateView
from blog.views import PostDeleteView


urlpatterns = [
    path('', PostListView.as_view(), name='index'),
    path('posts/', PostListView.as_view(), name ='post_list'),
    path('post/<slug:slug>', PostDetailView.as_view(), name='post_detail'),
    path('posts/create', PostCreateView.as_view(), name='post_create'),
    path('posts/<slug:slug>/edit', PostUpdateView.as_view(), name='post_update'),
    path('posts/<slug:slug>/delete', PostDeleteView.as_view(), name='post_delete'),
]
예제 #9
0
from django.urls import path
from blog.views import index, post_details, category_specific
from blog.views import ContactUsView, PostlistView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, SuccessView, SearchView
urlpatterns = [
    path("", PostlistView.as_view(), name='home'),
    path("<int:id>", category_specific, name='category_specific'),
    path('blog/<slug:slug>', PostDetailView.as_view(), name='post-detail'),
    path('contact', ContactUsView.as_view(), name='contact'),
    path('post', PostCreateView.as_view(), name='create_new'),
    path('post/<slug:slug>', PostUpdateView.as_view(), name='update_post'),
    path('post_delete/<slug:slug>',
         PostDeleteView.as_view(),
         name='delete_post'),
    path('success', SuccessView.as_view(), name='success'),
    path('url', SearchView.as_view(), name='search_page')
]
예제 #10
0
from django.conf.urls import url

from blog.views import PostListView, PostDetailView, PostCreateView, PostUpdateView

urlpatterns = [
    url(r'^post/$', PostListView.as_view(), name='post_list'),
    url(r'^post/(?P<pk>\d+)/$', PostDetailView.as_view(), name='post_detail'),
    url(r'^post/new/$', PostCreateView.as_view(), name='post_new'),
    url(r'^post/edit/(?P<pk>\d+)/$', PostUpdateView.as_view(), name='post_edit'),
]
예제 #11
0
파일: urls.py 프로젝트: oilujc/tuexperto
    path('profile/<slug:username>/', ProfileView.as_view(), name='profile'),

    #Auth System
    path('account/signin/', LoginView.as_view(template_name='auth/login.html',
                                    redirect_authenticated_user=True,
                                    extra_context={'title_page':'Sign in',
                                                   'breadcrumb':[(reverse_lazy('home'),'Inicio'), ('','Iniciar Sesión')]}
                                    ),
                                    name='signin'),

    path('account/logout/', LogoutView.as_view(), name='logout'),
    path('account/signup/', register_view, name='signup'),
    
    path('account/<slug:pt>/', UserPostListView.as_view(), name='user_post'),
    path('account/<slug:pt>/new', PostCreateView.as_view(), name='user_post_new'),
    path('account/<slug:pt>/<slug:slug>/edit', PostUpdateView.as_view(), name='user_post_edit'),
    path('account/<slug:pt>/<slug:slug>/delete', PostDeleteView.as_view(), name='user_post_delete'),

    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('select2/', include('django_select2.urls')),
    path('activate/<str:uidb64>/<str:token>', activate, name='activate'),

    #Api
    path('api/', include('api.urls')),

]
if settings.DEBUG:
    #static = Funcion auxiliar para devolver un patron de URL para servir archivos en modo debug
    urlpatterns += static(settings.STATIC_URL, document_root= settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root= settings.MEDIA_ROOT)
예제 #12
0
from django.urls import path
from blog.views import (PostDetailView, 
						PostUpdateView, 
						PostCreateView, 
						PostDeleteView, 
						ComentarioCreateView, 
						ComentarioDeleteView,
						HomePostDetailView,
                        Inicio
						)

from . import views

urlpatterns = [
    path('', Inicio.as_view(), name='blog-inicio'),
    path('inicio/', HomePostDetailView.as_view(), name='blog-home'),
    path('post/<int:pk>/', PostDetailView.as_view(), name='post-detail'),
    path('post/<int:pk>/actualizar/', PostUpdateView.as_view(), name='post-actualizar'),
    path('post/<int:pk>/eliminar/', PostDeleteView.as_view(), name='post-eliminar'),
    path('post/<int:pk>/agregar_comentario/', ComentarioCreateView.as_view(), name='post-agregar-comentario'),
    path('post/<int:pk>/eliminar_comentario/', ComentarioDeleteView.as_view(), name='eliminarComentario'),
    path('post/nuevo/', PostCreateView.as_view(), name='post-nuevo'),
]
예제 #13
0
    PostUpdateView,
    PostDeleteView,
    Draft,
    add_comment,
    publish_post,
    approve_comment,
    delete_comment,
    register_page,
)

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', PostListView.as_view(), name='post_list'),
    url(r'^(?P<pk>\d+)/$', PostDetailView.as_view(), name='post_detail'),
    url(r'^create/$', PostCreateView.as_view(), name='create'),
    url(r'^(?P<pk>\d+)/edit/$', PostUpdateView.as_view(), name='edit'),
    url(r'^(?P<pk>\d+)/delete/$', PostDeleteView.as_view(), name='delete'),
    url(r'^drafts/$', Draft.as_view(), name='draft'),
    url(r'^(?P<pk>\d+)/comment/$', add_comment, name='comment'),
    url(r'^comments/(?P<pk>\d+)/approve/$',
        approve_comment,
        name='approve_comment'),
    url(r'^comments/(?P<pk>\d+)/delete/$',
        delete_comment,
        name='delete_comment'),
    url(r'^(?P<pk>\d+)/publish/$', publish_post, name='publish'),
    url(r'^register/$', register_page, name='register'),
    url(r'^accounts/login/$', login, name='login'),
    url(r'^accounts/logout/$',
        logout,
        name='logout',
예제 #14
0
from django.urls import path
from blog.views import home, about, PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView

urlpatterns = [
    path('', PostListView.as_view(), name='blog-home'),
    path('post/new/', PostCreateView.as_view(), name='blog-post-create'),
    path('post/<str:uuid>/', PostDetailView.as_view(), name='blog-post-detail'),
    path('post/<str:uuid>/update/',
         PostUpdateView.as_view(), name='blog-post-update'),
    path('post/<str:uuid>/delete/',
         PostDeleteView.as_view(), name='blog-post-delete'),
    path('about/', about, name='blog-about')
]
예제 #15
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/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.contrib import admin
from django.urls import path
from blog.views import PostListView
from blog.views import PostDetailView
from django.conf.urls.static import static
from django.conf import settings
from blog.views import PostCreateView
from blog.views import PostUpdateView
from blog.views import PostDeleteView
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', PostListView.as_view(), name="post_list"),
    path('create/', PostCreateView.as_view(), name="post_create"),
    path('<pk>/', PostDetailView.as_view(), name="post_detail"),
    path('<pk>/update/', PostUpdateView.as_view(), name="post_update"),
    path('<pk>/delete/', PostDeleteView.as_view(), name="post_delete"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(
    settings.STATIC_URL, document_root=settings.STATIC_ROOT)
예제 #16
0
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import LoginView, LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView
from blog.views import blog_view, PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, UserPostListView
from home.views import home_view
from checks.views import checkAdd, narc_check_view, check_home_view, WeeklyCheckView, post_unit_view, AddDrugNarcBox, SubDrugNarcBox
from safe.views import check_safe_view, safe_home_view, AddDrug, SubDrug, CheckDrug, search_drug
from components.views import component_home_view, add_drug, add_vehicle, profile, register, UnitUpdateView, UnitListView, UnitDetailView, DrugListView, DrugUpdateView, MedicCreateView, MedicListView, MedicUpdateView

urlpatterns = [
    path('blog/', PostListView.as_view(), name='blog'),
    path('user/<str:username>/', UserPostListView.as_view(),
         name='user_posts'),
    path('blog/new/', PostCreateView.as_view(), name='blog_create'),
    path('blog/<int:pk>/update/', PostUpdateView.as_view(),
         name='blog_update'),
    path('blog/<int:pk>/delete/', PostDeleteView.as_view(),
         name='blog_delete'),
    path('blog/<int:pk>/', PostDetailView.as_view(), name='blog_detail'),
    path('checks/', check_home_view, name='check_home_view'),
    path('checks/home/', post_unit_view, name='post_unit_view'),
    path('checks/daily/', checkAdd.as_view(), name='daily'),
    path('checks/weekly/', WeeklyCheckView.as_view(), name='weekly'),
    path('checks/narc_daily/', narc_check_view, name='narc_daily'),
    path('checks/narc_add/', AddDrugNarcBox.as_view(), name='narc_add'),
    path('checks/narc_sub/', SubDrugNarcBox.as_view(), name='narc_sub'),
    path('safe/', safe_home_view, name='safe_home_view'),
    path('safe/check/', check_safe_view, name='safe_check_view'),
    path('safe/add/', AddDrug.as_view(), name='safe_add_view'),
    path('safe/remove/', SubDrug.as_view(), name='safe_remove_view'),
예제 #17
0
    # Example : /blog/archive/
    path('archive/', PostAV.as_view(), name='post_archive'),

    # Example: /blog/archive/2019/
    path('archive/<int:year>/', PostYAV.as_view(), name='post_year_archive'),

    # Example: /blog/archive/2019/12/
    path('archive/<int:year>/<int:month>/',
         PostMAV.as_view(),
         name='post_month_archive'),

    # Example: /blog/archive/2019/12/17/
    path('archive/<int:year>/<int:month>/<int:day>/',
         PostDAV.as_view(),
         name='post_day_archive'),

    # Example: /blog/archive/today/
    path('archive/today/', PostTAV.as_view(), name='post_today_archive'),

    # Example: /blog/add/
    path('add/', PostCreateView.as_view(), name="add"),

    # Example: /blog/change/
    path('change/', PostChangeLV.as_view(), name="change"),

    # Example: /blog/99/delete/
    path('<int:pk>/delete/', PostDeleteView.as_view(), name="delete"),

    # Example: /blog/99/update/
    path('<int:pk>/update/', PostUpdateView.as_view(), name="update"),
]
예제 #18
0
파일: urls.py 프로젝트: coldwhiskeyman/blog
from django.urls import path

from blog.views import (
    PostCreateView,
    PostDetailView,
    PostListView,
    PostUpdateView,
    PostUploadView,
)

urlpatterns = [
    path('', PostListView.as_view(), name='post_list'),
    path('upload', PostUploadView.as_view(), name='post_upload'),
    path('add', PostCreateView.as_view(), name='post_create'),
    path('<int:pk>', PostDetailView.as_view(), name='post_details'),
    path('<int:pk>/update', PostUpdateView.as_view(), name='post_update'),
]
예제 #19
0
파일: urls.py 프로젝트: schir2/schirus
from django.urls import path, include

from blog.views import CategoryAutoCompleteView
from blog.views import PostDetailView, PostListView, PostCreateView, PostUpdateView, PostDeleteView, PostLikeView

urlpatterns = [
    path('category',
         CategoryAutoCompleteView.as_view(create_field='name'),
         name='category-autocomplete'),
    path('', PostListView.as_view(), name='post-list'),
    path('', PostListView.as_view(), name='home'),
    path('create', PostCreateView.as_view(), name='post-create'),
    path(
        '<str:slug>-<int:pk>/',
        include([
            path('', PostDetailView.as_view(), name='post-detail'),
            path('update', PostUpdateView.as_view(), name='post-update'),
            path('delete', PostDeleteView.as_view(), name='post-delete'),
            path('like', PostLikeView.as_view(), name='post-like'),
        ]))
]
예제 #20
0
from django.conf.urls import include, url
from django.contrib import admin

from django.conf.urls.static import static
from django.conf import settings

from blog.views import PostCreateView, PostDetailView, PostUpdateView, PostDeleteView, index
from gallery.views import PhotoCreateView, PhotoListView

# AjaxPhotoUploadView,     url(r'^(?P<pk>\d+)/ajax-upload/$', AjaxPhotoUploadView.as_view(), name='ajax_photo_upload_view',),

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', index, name='list'),
    url(r'^create/$', login_required(PostCreateView.as_view()), name='create'),
    url(r'^detail/(?P<pk>[0-9]+)/$', PostDetailView.as_view(), name='detail'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        login_required(PostUpdateView.as_view()),
        name='update'),
    url(r'^delete/(?P<pk>[0-9]+)/$',
        login_required(PostDeleteView.as_view()),
        name='delete'),
    url(r'^photo_create/$',
        login_required(PhotoCreateView.as_view()),
        name='photo-create'),
    url(r'^photo_list/$', PhotoListView.as_view(), name='photo-list'),
    url(r'^login/$', 'django.contrib.auth.views.login'),
    url(r'^logout/$', 'django.contrib.auth.views.logout'),
    url(r'^tinymce/', include('tinymce.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
예제 #21
0
from django.urls import path

from blog import views
from blog.views import (PostCreateView, PostDetailView, PostListView,
                        PostDeleteView, PostUpdateView, UserPostListView)

urlpatterns = [
    # Since we want it to be the blog homepage we leave the string, blank.
    path("", PostListView.as_view(), name="blog-home"),
    path("post/new/", PostCreateView.as_view(), name="post-create"),
    path("post/<int:pk>/", PostDetailView.as_view(), name="post-detail"),
    path("post/<int:pk>/update/", PostUpdateView.as_view(),
         name="post-update"),
    path("post/<int:pk>/delete/", PostDeleteView.as_view(),
         name="post-delete"),
    path("user/<str:username>/", UserPostListView.as_view(), name="user-post"),
    path("about", views.about, name="blog-about"),
]
예제 #22
0
    CreatePostView,
    PostUpdateView,
    PostDeleteView,
    DraftListView,
    comment_approve,
    comment_remove,
    post_publish,
    add_comment_to_post,
)

urlpatterns = [
    path("", postListView.as_view(), name="post_list"),
    path("about/$", AboutView.as_view(), name="about"),
    path("posts/<int:pk>/$", postDetailView.as_view(), name="post_detail"),
    path("posts/new/$", CreatePostView.as_view(), name="post_new"),
    path("posts/<int:pk>/update$", PostUpdateView.as_view(), name="post_edit"),
    path("posts/<int:pk>/delete$",
         PostDeleteView.as_view(),
         name="post_remove"),
    path("draft/$", DraftListView.as_view(), name="post_draft_list"),
    path(
        "posts/<int:pk>/comment/$",
        views.add_comment_to_post,
        name="add_comment_to_post",
    ),
    path("comment/<int:pk>/approve/$",
         views.comment_approve,
         name="comment_approve"),
    path("comment/<int:pk>/remove/$",
         views.comment_remove,
         name="comment_remove"),
예제 #23
0
from django.urls import path
from blog.views import (PostListView, PostCreateView, PostDetailView,
                        PostUpdateView, PostDeleteView, CommentView,
                        CommentDeleteView)

app_name = "blog"

urlpatterns = [
    # User posts
    path('user/<str:username>/', PostListView.as_view(), name='user-posts'),
    # Posts by date
    path('date/<str:date>/', PostListView.as_view(), name='date-posts'),
    # New post
    path('new/', PostCreateView.as_view(), name='new-post'),
    # All post
    path('<slug>/', PostDetailView.as_view(), name='post-detail'),
    # Update post
    path('<slug>/update/', PostUpdateView.as_view(), name='post-update'),
    # Delete post
    path('<slug>/delete/', PostDeleteView.as_view(), name='post-delete'),
    # New comment
    path('comment/<slug>/new/', CommentView.as_view(), name='new-comment'),
    # Delete comment
    path('comment/delete/<int:pk>/',
         CommentDeleteView.as_view(),
         name='comment-delete'),
]
예제 #24
0
from django.conf.urls import url
from blog.views import (
    AboutView,
    CreatePostView,
    DraftListView,
    PostDetailView,
    PostDeleteView,
    PostListView,
    PostUpdateView,
)

urlpatterns = [
    url(r"^$", PostListView.as_view(), name="post_list"),
    url(r"^about/$", AboutView.as_view(), name="about"),
    url(r"^post/(?P<pk>\d+)$", PostDetailView.as_view(), name="post_detail"),
    url(r"^post/new/$", CreatePostView.as_view(), name="post_new"),
    url(r"^post/(?P<pk>\d+)/edit/$",
        PostUpdateView.as_view(),
        name="post_edit"),
    url(r"^post/(?P<pk>\d+)/remove/$",
        PostDeleteView.as_view(),
        name="post_remove"),
    url(r"^drafts/$", DraftListView.as_view(), name="post_drafts_list"),
]
예제 #25
0
from django.urls import path

from blog import views
from blog.views import (PostCreateView, PostDeleteView, PostDetailView,
                        PostListView, PostUpdateView)

urlpatterns = [
    path("", PostListView.as_view(), name="blog-home"),
    path("post/<int:pk>/", PostDetailView.as_view(), name="post-detail"),
    path("post/<int:pk>/update", PostUpdateView.as_view(), name="post-update"),
    path("post/<int:pk>/delete", PostDeleteView.as_view(), name="post-delete"),
    path("post/new/", PostCreateView.as_view(), name="post-create"),
    path("about/", views.about, name="blog-about"),
]
예제 #26
0
from blog.views import (main, sign_up, CustomLoginView, PostListView, PostFormView, PostUpdateView, PostDeleteView,
                        new_comment_leave, unsubscribe_view, logout_view)

from blog.ui_views import PostsListUIView, PostUIView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include([
        path('', PostsListUIView.as_view(), name='ui_posts_list'),
        path('post/<slug:slug>/<int:pk>', PostUIView.as_view(), name='ui_post'),
    ])),
    path('uviyti', CustomLoginView.as_view(), name='login'),
    path('logout', logout_view, name='logout'),
    path('sign-up', sign_up, name='sign_up'),
    path('ckeditor/', include('ckeditor_uploader.urls')),

    path('admin-panel/', include([
        path('', main, name='index'),
        path('posts-list', PostListView.as_view(), name='posts-list'),
        path('post-add', PostFormView.as_view(), name='post-add'),
        path('post-edit/<slug:slug>/<int:pk>', PostUpdateView.as_view(), name='post-edit'),
        path('post-delete/<slug:slug>/<int:pk>', PostDeleteView.as_view(), name='post-delete'),
    ])),

    path('test_url/', new_comment_leave, name='new_comment'),
    path('unsubscribe/<uidb64>/<token>', unsubscribe_view, name='unsubscribe'),
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATICFILES_DIRS)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
예제 #27
0
from django.urls import path
from blog.views import (index, PostListView, PostDetailView, PostCreateView,
                        PostUpdateView, PostDeleteView)

urlpatterns = [
    path('', PostListView.as_view(), name='index'),
    path('post/create/', PostCreateView.as_view(), name='post-create'),
    path('post/<str:pk>/', PostDetailView.as_view(), name='post-detail'),
    path('post/<str:pk>/update/', PostUpdateView.as_view(),
         name='post-update'),
    path('post/<str:pk>/delete/', PostDeleteView.as_view(),
         name='post-delete'),
]
예제 #28
0
from django.urls import path
from . import views
from blog.views import (PostListView,
                        PostDetailView,
                        PostCreateView,
                        PostUpdateView,
                        PostDeleteView,
                        UserPostListView,
                        AddCommentView,
                        )

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(template_name='blog/post_detail.html'), name='post-detail'),
    path('post/<int:pk>/comment/', AddCommentView.as_view(template_name='blog/add_comment.html'), name='post_comment'),
    path('post/<int:pk>/update/', PostUpdateView.as_view(), name='post-update'),
    path('post/<int:pk>/delete/', PostDeleteView.as_view(template_name='blog/post_confirm_delete.html'),
         name='post-delete'),
    path('post/new/', PostCreateView.as_view(template_name='blog/post_form.html'), name='post-create'),
    path('about/', views.about, name='blog-about'),
]
예제 #29
0
    about,
)
from users.forms import ForgotPasswordForm
from users.views import(
    signup,
    profile
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', PostListView.as_view(), name="blog-home"),
    path('user-profile/', profile, name="user-profile"),  
    path('<str:username>-posts/', UserPostListView.as_view(), name="userposts-list"),
    path('post-<int:pk>/', PostDetailView.as_view(), name="post-detail"),
    path('new-post/', 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/', about, name="blog-about"),
    path('signup/', signup, name="user-signup"),
    path('signin/', LoginView.as_view(template_name="users/signin.html"), name="user-signin"),
    path('signout/', LogoutView.as_view(template_name="users/signout.html"), name="user-signout"),
    path('password-reset/', PasswordResetView.as_view(template_name="users/password_reset.html", form_class=ForgotPasswordForm), name="password_reset"),
    path('password-reset/done/', PasswordResetDoneView.as_view(template_name="users/password_reset_done.html"), name="password_reset_done"),
    path('password-reset/confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(template_name="users/password_reset_confirm.html"), name="password_reset_confirm"),
    path('password-reset/complete/', PasswordResetCompleteView.as_view(template_name="users/password_reset_complete.html"), name="password_reset_complete"),
    path('password-change/', PasswordChangeView.as_view(template_name="users/password_change.html"), name="password_change"),
    path('password-change/done/', PasswordChangeDoneView.as_view(template_name="users/password_change_done.html"), name="password_change_done"),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)