Ejemplo n.º 1
0
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')
]
Ejemplo n.º 2
0
Archivo: urls.py Proyecto: 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')
]
Ejemplo n.º 3
0
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'),  
]
Ejemplo n.º 4
0
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')
]
Ejemplo n.º 5
0
#encoding=utf-8
from django.conf.urls import patterns, url
from django.views.generic import ListView
from views import ArticleCommentCreateView,  ArticleDetailView,  AddArticlePreview, ArticleUpdateView, ArticleListView, ArticleRssView
from views import toggle_favorite, approve
from forms import AddArticleForm
from models import Article
from django.contrib.auth.decorators import login_required

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(),
        ),
Ejemplo n.º 6
0
# -*- 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'),
)
Ejemplo n.º 7
0
# -*- coding: utf-8 -*-
from django.conf.urls import url
from views import ArticleListView, ArchiveListView

urlpatterns = [
    url(r'^(?P<year_month>\d{4}-\d{2})$',
        ArchiveListView.as_view(template_name="blog/index.html"),
        name='month-archive-view'),
    url(r'^$',
        ArticleListView.as_view(template_name="blog/index.html"),
        name='article-list-view'),
]
Ejemplo n.º 8
0
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'),


)
Ejemplo n.º 9
0
from django.conf.urls import url
from views import blog_test
from views import ArticleListView
from views import ArticlePublishView

urlpatterns = [
	# url(r'^$', views.blog_index, name="blog_index"),
	url(r'^$', ArticleListView.as_view(), name="blog_index"),
	url(r'^testing$', blog_test, name="for_test"),
	url(r'^article/publish$', ArticlePublishView.as_view(), name="article_publish"),

]
Ejemplo n.º 10
0
Archivo: urls.py Proyecto: winglq/site
"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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 views import ArticleDetailView, ArticleListView
from views import ArticleCreateView, ArticleUpdateView

urlpatterns = [
    url(r'^create/$', ArticleCreateView.as_view(),
        name='article_create'),
    url(r'^detail/(?P<pk>[0-9]{0,10})/$',
        ArticleDetailView.as_view(), name='article_detail'),
    url(r'^list/$', ArticleListView.as_view(),
        name='article_list'),
    url(r'^update/(?P<pk>[0-9]{0,10})/$', ArticleUpdateView.as_view(), name='article_update'),
]
Ejemplo n.º 11
0
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'),
)