コード例 #1
0
from django.urls import path

from blog.views import BlogList, BlogDetail, BlogCreate, BlogUpdate, BlogDelete

urlpatterns = [
    path('', BlogList.as_view(), name='home'),
    path('post/<int:pk>/', BlogDetail.as_view(), name='post_detail'),
    path('post/new/', BlogCreate.as_view(), name='post_new'),
    path('post/<int:pk>/edit/', BlogUpdate.as_view(), name='post_edit'),
    path('post/<int:pk>/delete/', BlogDelete.as_view(), name='post_delete'),
]
コード例 #2
0
ファイル: urls.py プロジェクト: firenovell/broomtrade
from django.conf.urls import url
from django.contrib.auth.decorators import permission_required

from blog.views import BlogListView, BlogDetailView, BlogCreate, BlogUpdate, BlogDelete

urlpatterns = [
  url(r'^$', BlogListView.as_view(), name = "blog_index"),
  url(r'^(?P<pk>\d+)/detail/$', BlogDetailView.as_view(), name = "blog_detail"),
  url(r'^add/$', permission_required("blog.add_blog")(BlogCreate.as_view()), name = "blog_add"),
  url(r'^(?P<pk>\d+)/edit/$', permission_required("blog.change_blog")(BlogUpdate.as_view()), name = "blog_edit"),
  url(r'^(?P<pk>\d+)/delete/$', permission_required("blog.delete_blog")(BlogDelete.as_view()), name = "blog_delete"),
]
コード例 #3
0
from django.conf.urls import url
from django.contrib.auth.decorators import permission_required

from blog.views import BlogListView, BlogDetailView, BlogCreate, BlogUpdate, BlogDelete

urlpatterns = [
    url(r'^$', BlogListView.as_view(), name="blog_index"),
    url(r'^(?P<pk>\d+)/detail/$', BlogDetailView.as_view(),
        name="blog_detail"),
    url(r'^add/$',
        permission_required("blog.add_blog")(BlogCreate.as_view()),
        name="blog_add"),
    url(r'^(?P<pk>\d+)/edit/$',
        permission_required("blog.change_blog")(BlogUpdate.as_view()),
        name="blog_edit"),
    url(r'^(?P<pk>\d+)/delete/$',
        permission_required("blog.delete_blog")(BlogDelete.as_view()),
        name="blog_delete"),
]
コード例 #4
0
# admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^$', PostList.as_view(), name='home'),
    url(r'^login$','django.contrib.auth.views.login', name='login'),
    url(r'^logout$','django.contrib.auth.views.logout', {'next_page' : '/'} , name='logout')  ,
    url(r'^user/settings$',UserUpdate.as_view(), name='settings'),
    url(r'^user/signup/$', UserCreate.as_view(), name='signup'),
    url(r'^user/delete/$', UserDelete.as_view(), name='user_delete') ,
    url(r'^user/password-change/$', PasswordChangeView.as_view(), name='user_pass_change') ,

    url(r'^user/createblog$', BlogCreate.as_view(), name='blog_create') ,
    # the next ilne has an error, it regexp has to be tested against possible values for the username
    
    url(r'^user/settings/blog$', BlogUpdate.as_view(), name='blog_update') ,
    url(r'^user/settings/blog/delete$', BlogDelete.as_view(), name='blog_delete') ,
    
    url(r'^user/post$', PostCreate.as_view(), name='post_create') ,

    url(r'^(?P<slug>[-_\w]+)/$', BlogDetail.as_view(), name='blog') ,
    
    url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)$', PostDetail.as_view(), name='post') ,
    url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)/comment/(?P<pk>\d+)/delete$', CommentDelete.as_view(), name='comment_delete') ,
    url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)/edit$', PostUpdate.as_view(), name='post_update') ,
    url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)/delete$', PostDelete.as_view(), name='post_delete') ,
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
コード例 #5
0
ファイル: urls.py プロジェクト: Jafte/jasn.ru
from django.conf.urls import url
from blog.views import BlogDetail, BlogPostDetail, BlogList, BlogUpdate, BlogCreate, BlogPostCreate, BlogPostUpdate, \
    BlogPostImageCreate

urlpatterns = [
    url(r'^$', BlogList.as_view(), name='blog-list'),
    url(r'^add/$', BlogCreate.as_view(), name='blog-create'),
    url(r'^(?P<blog_slug>[\w-]+)/post-create/$',
        BlogPostCreate.as_view(),
        name='blog-post-create'),
    url(r'^(?P<blog_slug>[\w-]+)/update/$',
        BlogUpdate.as_view(),
        name='blog-update'),
    url(r'^(?P<blog_slug>[\w-]+)/p(?P<post_pk>[0-9]+)/$',
        BlogPostDetail.as_view(),
        name='blog-post-detail'),
    url(r'^(?P<blog_slug>[\w-]+)/p(?P<post_pk>[0-9]+)/update/$',
        BlogPostUpdate.as_view(),
        name='blog-post-update'),
    url(r'^(?P<blog_slug>[\w-]+)/$', BlogDetail.as_view(), name='blog-detail'),
    url(r'^img/add/$', BlogPostImageCreate.as_view(), name='image-create'),
]
コード例 #6
0
ファイル: urls.py プロジェクト: qinchongshuang/mysite
from django.conf.urls import url
from blog.views import BlogCreate, BlogList, BlogPaginator, BlogDetail, BlogDelete, BlogUpdate
from blog import views

urlpatterns = [
    url(r'^$', BlogPaginator.as_view(), name='blog_list'),
    url(r'^blog_create$', BlogCreate.as_view(), name='blog_create'),
    url(r'^blog_update(?P<post_id>\d*)$', BlogUpdate.as_view(), name='blog_update'),
    url(r'^blog_delete(?P<post_id>\d*)$', BlogDelete.as_view(), name='blog_delete'),
    url(r'^blog_detail(?P<post_id>\d*)$', BlogDetail.as_view(), name='blog_detail'),
]
コード例 #7
0
ファイル: urls.py プロジェクト: Kuzzmich/broomtrade
from django.contrib.auth.decorators import permission_required
from django.urls import re_path
from blog.views import BlogListView, BlogDetailView, BlogCreate, BlogUpdate, BlogDelete

urlpatterns = [
    re_path(r'^$', BlogListView.as_view(), name='blog_index'),
    re_path(r'^(?P<pk>\d+)/detail/$', BlogDetailView.as_view(), name='blog_detail'),
    re_path(r'^add/$', permission_required('blog.add_blog')(BlogCreate.as_view()), name='blog_add'),
    re_path(r'^(?P<pk>\d+)/edit/$', permission_required('blog.change_blog')(BlogUpdate.as_view()), name='blog_edit'),
    re_path(r'^(?P<pk>\d+)/delete/$', permission_required('blog.delete_blog')(BlogDelete.as_view()), name='blog_delete'),
]
コード例 #8
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/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 url, include
from django.contrib.auth.decorators import permission_required
from blog.views import BlogListView, BlogDetailView, BlogCreate, BlogUpdate, \
BlogDelete


urlpatterns = [
    url(r'^$', BlogListView.as_view(), name="blog_index"),
    url(r'^(?P<pk>\d+)/detail/$', BlogDetailView.as_view(), name="blog_detail"),
    url(r'^add/$', permission_required("blog.add_blog")\
        (BlogCreate.as_view()), name="blog_add"),
    url(r'^(?P<pk>\d+)/edit/$', permission_required("blog.change_blog")\
        (BlogUpdate.as_view()), name="blog_edit"),
    url(r'^(?P<pk>\d+)/delete/$', permission_required("blog.delete_blog")\
        (BlogDelete.as_view()), name="blog_delete"),
]
コード例 #9
0
# coding; utf-8
from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from blog.views import BlogList, BlogDetail, PostDetail, PostUpdate, PostCreate, BlogCreate, BlogUpdate

urlpatterns = [
    url(r'^$', BlogList.as_view(), name="blog_list"),
    url(r'^(?P<pk>\d+)/$', BlogDetail.as_view(), name="blog_detail"),
    url(r'^post/(?P<pk>\d+)/$', PostDetail.as_view(), name="post_detail"),
    url(r'^post/update/(?P<pk>\d+)/$',
        login_required(PostUpdate.as_view()),
        name="post_update"),
    url(r'^post/create/$',
        login_required(PostCreate.as_view()),
        name="post_create"),
    url(r'^update/(?P<pk>\d+)/$',
        login_required(BlogUpdate.as_view()),
        name="blog_update"),
    url(r'^create/$', login_required(BlogCreate.as_view()),
        name="blog_create"),
]
コード例 #10
0
ファイル: urls.py プロジェクト: 32bitman/webstore-django
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import permission_required
from blog.views import BlogListView, BlogDetailView, BlogCreate, BlogUpdate, BlogDelete

urlpatterns = patterns('',
                       url(r'^$', BlogListView.as_view(), name="blog_index"),
                       url(r'^(?P<pk>\d+)/detail/$', BlogDetailView.as_view(), name="blog_detail"),
                       url(r'^add/$', permission_required("blog.add_blog")(BlogCreate.as_view()), name="blog_add"),
                       url(r'^(?P<pk>\d+)/edit/$', permission_required("blog.change_blog")(BlogUpdate.as_view()),
                           name="blog_edit"),
                       url(r'^(?P<pk>\d+)/delete/$', permission_required("blog.delete_blog")(BlogDelete.as_view()),
                           name="blog_delete"),
                       )
コード例 #11
0
from django.urls import path, re_path

from blog.views import (IndexList, BlogCreate, BlogView, BlogUpdate,
                        BlogsUserView)

app_name = 'blog'
urlpatterns = [
    path('', IndexList.as_view(), name='index'),
    re_path(r'^_rubrics/(?P<rubric>(imho|festivals|music))/$',
            IndexList.as_view(),
            name='rubric'),
    path('new/', BlogCreate.as_view(), name='create'),
    path('list/', BlogsUserView.as_view(), name='list'),
    path('<slug:slug>/', BlogView.as_view(), name='view'),
    path('<slug:slug>/edit/', BlogUpdate.as_view(), name='edit'),
]
コード例 #12
0
 '',
 # Examples:
 url(r'^$', PostList.as_view(), name='home'),
 url(r'^login$', 'django.contrib.auth.views.login', name='login'),
 url(r'^logout$',
     'django.contrib.auth.views.logout', {'next_page': '/'},
     name='logout'),
 url(r'^user/settings$', UserUpdate.as_view(), name='settings'),
 url(r'^user/signup/$', UserCreate.as_view(), name='signup'),
 url(r'^user/delete/$', UserDelete.as_view(), name='user_delete'),
 url(r'^user/password-change/$',
     PasswordChangeView.as_view(),
     name='user_pass_change'),
 url(r'^user/createblog$', BlogCreate.as_view(), name='blog_create'),
 # the next ilne has an error, it regexp has to be tested against possible values for the username
 url(r'^user/settings/blog$', BlogUpdate.as_view(), name='blog_update'),
 url(r'^user/settings/blog/delete$',
     BlogDelete.as_view(),
     name='blog_delete'),
 url(r'^user/post$', PostCreate.as_view(), name='post_create'),
 url(r'^(?P<slug>[-_\w]+)/$', BlogDetail.as_view(), name='blog'),
 url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)$',
     PostDetail.as_view(),
     name='post'),
 url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)/comment/(?P<pk>\d+)/delete$',
     CommentDelete.as_view(),
     name='comment_delete'),
 url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)/edit$',
     PostUpdate.as_view(),
     name='post_update'),
 url(r'^(?P<username>[-_\w]+)/(?P<slug>[-_\w]+)/delete$',