コード例 #1
0
ファイル: urls.py プロジェクト: sunjzz/blog
# -*- coding: utf-8 -*-
# @author ZhengZhong,Jiang
# @time 2017/7/28 14:43
from django.conf.urls import url
from views import ArticleListView, ArticleDetailView, ArticleCreateView

urlpatterns = [
    url(r'^list/$', ArticleListView.as_view(), name='article_list'),
    url(r'^detail/(?P<article_id>\d+)/$', ArticleDetailView.as_view(), name='article_detail'),
    url(r'^create/$', ArticleCreateView.as_view(), name='article_create')
]
コード例 #2
0
ファイル: urls.py プロジェクト: fanshouxing/xblog
from django.conf.urls import url
from django.contrib.sitemaps.views import sitemap

from views import ArticleListView, ArticlePublishView, ArticleDetailView, ArticleEditView, BlogSitemap

urlpatterns = [
    url(r'^$', ArticleListView.as_view(), name='blog_index'),
    url(r'^article/publish$', ArticlePublishView.as_view(), name='article_publish'),
    url(r'^article/(?P<title>\w+\.?\w+)$', ArticleDetailView.as_view(), name='article_detail'),
    url(r'^article/(?P<title>\w+\.?\w+)/edit$', ArticleEditView.as_view(), name='article_edit'),

    #sitemap
    url(r'^sitemap\.xml$', sitemap, {'sitemaps': {'blog': BlogSitemap}}, name='django.contrib.sitemaps.views.sitemap')
]
コード例 #3
0
ファイル: urls.py プロジェクト: rerb/stars
from django.conf.urls import url

from views import ArticleDetailView, OldPathRedirectView

app_name = 'old_cms'

urlpatterns = [
    url(r'^[^\/]+/(?P<nid>\d+)/$',
        OldPathRedirectView.as_view(),
        name='cms-old-path-redirect'),
    url(r'^(?P<category_slug>[^\/]+)/(?P<article_slug>[^\/]+).html$',
        ArticleDetailView.as_view(),
        name='cms-article-detail')
]
コード例 #4
0
ファイル: urls.py プロジェクト: rrajesh0205/blog
from views import ArticleListView, ArticleDetailView, CreatePostView, ArticleUpdate, ArticleDelete, ArticleAboutView
from django.urls import path


urlpatterns = [
    path('', ArticleListView.as_view(), name='home'),
    path('article/<int:pk>', ArticleDetailView.as_view(), name='detail'),
    path('create/', CreatePostView.as_view(), name='create'),
    path('create/<int:pk>/', ArticleUpdate.as_view(), name='article_edit'),
    path('delete/<int:pk>/', ArticleDelete.as_view(), name='delete'),  
    path('about/', ArticleAboutView.as_view(), name='about'),  
]
コード例 #5
0
ファイル: urls.py プロジェクト: hzlf/openbroadcast.ch
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from views import ArticleDetailView

urlpatterns = patterns(
    "ticker.views", url(r"^(?P<slug>[-\w]+)/$", ArticleDetailView.as_view(), name="ticker-article-detail")
)
コード例 #6
0
ファイル: urls.py プロジェクト: agrybas/nylithuanian
urlpatterns = patterns('',
    url(r'^$',
        ArticleListView.as_view()
        ),
                       
    url(r'^rss/$', ArticleRssView()),
                       
    url(r'^pateikti/$',
        login_required(login_url='/nariai/prisijungti')(AddArticlePreview(AddArticleForm))
        ),
                       
    #url(r'^archyvas/$', PastEventsListView.as_view()),
    
    url(r'^(?P<pk>\d+)/$',
        ArticleDetailView.as_view()
        ),
    
    url(r'^(?P<pk>\d+)/patvirtinti/$', approve),
                       
    url(r'^(?P<pk>\d+)/redaguoti/$',
        ArticleUpdateView.as_view(),
        ),
                       
    #url(r'^(?P<pk>\d+)/redaguoti/$', ArticleUpdateView.as_view()),
    
    url(r'^(?P<pk>\d+)/komentarai/$',
        ArticleCommentCreateView.as_view()
        ),
                       
    url(r'^(?P<pk>\d+)/pazymeti/$', login_required(login_url='/nariai/prisijungti')(toggle_favorite)),
コード例 #7
0
ファイル: urls.py プロジェクト: lambdalisue/django-nonrelblog
# -*- coding: utf-8 -*-
#
# Author:        alisue
# Date:            2011/02/27
#
from django.conf.urls.defaults import url, patterns

from views import CreateArticleView
from views import UpdateArticleView
from views import DeleteArticleView
from views import ArticleListView
from views import ArticleDetailView

urlpatterns = patterns('',
    url(r'^$', ArticleListView.as_view(), name='simpleblogs_article_list'),
    url(r'^(?P<pk>\d+)/$', ArticleDetailView.as_view(), name='simpleblogs_article_detail'),
    url(r'^create/$', CreateArticleView.as_view(), name='simpleblogs_article_create'),
    url(r'^update/(?P<pk>\d+)/$', UpdateArticleView.as_view(), name='simpleblogs_article_update'),
    url(r'^delete/(?P<pk>\d+)/$', DeleteArticleView.as_view(), name='simpleblogs_article_delete'),
)
コード例 #8
0
# coding: utf-8

from django.conf.urls import patterns, include, url
from views import IndexView, ArticleDetailView
# admin
from django.contrib import admin
admin.autodiscover()

# xadmin
import xadmin
xadmin.autodiscover()


urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'doit.views.home', name='home'),
    url(r'^index/', IndexView.as_view(), name='index_view'),
    url(r'^article/(?P<pk>[0-9]+)/$', ArticleDetailView.as_view(), name='article_detail'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^xadmin/', include(xadmin.site.urls)),
)
コード例 #9
0
ファイル: urls.py プロジェクト: dreidev/django-favorites
from django.conf.urls import patterns, url
from views import ArticleDetailView, ArticleListView

urlpatterns = patterns(
    '',
    url(
        r'^article/list/(?P<pk>[0-9]+)/$',
        ArticleDetailView.as_view(), name='article-detail'),
    url(r'^$', ArticleListView.as_view(), name='article-list'),


)
コード例 #10
0
ファイル: urls.py プロジェクト: JustF0rWork/lblog
from django.conf.urls import url,include
from django.contrib import admin
from views import ArticleListView,ArticlePublishView,ArticleDetailView,ArticleEditView,RegisterView

urlpatterns=[
    url(r'^$', ArticleListView.as_view(), name='blog_index'),
    url(r'^article/publish$',ArticlePublishView.as_view(),name='article_publish'),
    url(r'^article/(?P<title>[^\/])$',ArticleDetailView.as_view(), name='article_detail'),
    url(r'^article/(?P<title>\w+)/edit$',ArticleEditView.as_view(), name='article_edit'),
    url(r'^register$',RegisterView.as_view(),name='register'),
]
コード例 #11
0
ファイル: urls.py プロジェクト: zsjyzx/my-first-xblog
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 url
from django.contrib.sitemaps.views import sitemap

from views import ArticleListView, ArticlePublishView, ArticleDetailView, ArticleEditView, BlogSitemap

#from . import views

urlpatterns = [

    url(r'^$', ArticleListView.as_view(), name='blog_index'),
    url(r'^article/publish$', ArticlePublishView.as_view(), name='article_publish'),
    url(r'^article/(?P<title>\w+\.?\w+)$', ArticleDetailView.as_view(), name='article_detail'),
    url(r'^article/(?P<title>\w+\.?\w+)/edit$', ArticleEditView.as_view(), name='article_edit'),

    # sitemap
    url(r'^sitemap\.xml$', sitemap, {'sitemaps': {'blog': BlogSitemap}}, name='django.contrib.sitemaps.views.sitemap')

]
コード例 #12
0
from django.conf.urls import url,include
from views import ArticleEdit, ArticleDetailView,RegisterView
urlpatterns=[
        url(r'^$','blog.views.index',name='index'),
        url(r'^article/publish/$',ArticleEdit.as_view(),name='ArticleEdit'),
        url(r'^article/(?P<title>\S+)$',ArticleDetailView.as_view(),name='ArticleDetail'),
        url(r'^register/$',RegisterView.as_view(),name='register'),
        url(r'^login/$','blog.views.loginview',name='login'),
        url(r'^loginout/$','blog.views.loginoutview',name='loginoutview'),
        url(r'^url_image/','blog.views.url_qrcode'),
        url(r'^search/','blog.views.SearchView'),
]