コード例 #1
0
ファイル: urls.py プロジェクト: aevans1910/happy-me
from django.urls import path
from blog.views import PostsListView, PostsDetailView, PostsCreateView

urlpatterns = [
    path('', PostsListView.as_view(), name='blog-list-page'),
    path('new/', PostsCreateView.as_view(), name='new'),
    path('<str:slug>/', PostsDetailView.as_view(), name='blog-details-page'),
]
コード例 #2
0
ファイル: urls.py プロジェクト: kasv/myblog
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url

from blog.views import PostsListView, PostDetailView


urlpatterns = patterns(
    "", url(r"^$", PostsListView.as_view(), name="list"), url(r"^(?P<pk>\d+)/$", PostDetailView.as_view())
)
コード例 #3
0
# -*- coding: utf-8 -*-

from django.conf.urls import url
from blog.views import PostsListView, PostDetailView
from django.views.decorators.cache import cache_page

urlpatterns = [
    url(r'^$', cache_page(60 * 15)(PostsListView.as_view()), name='Postlist'),
    url(r'^(?P<pk>\d+)/$',
        cache_page(60 * 15)(PostDetailView.as_view()),
        name='Detallist'),
]
コード例 #4
0
ファイル: urls.py プロジェクト: mairetham/django
#coding: utf-8
from django.conf.urls import patterns, url

from blog.views import PostsListView, PostDetailView 

urlpatterns = patterns('',
url(r'^$', PostsListView.as_view(), name='list'),
url(r'^(?P<pk>\d+)/$', PostDetailView.as_view()),
)
コード例 #5
0
ファイル: urls.py プロジェクト: romanyakovlev/my_project
# -*- coding: utf-8 -*-

from django.conf.urls import *


from blog.views import (PostsListView, PostDetailView, submit_ajax, submit,
 delete_all_objects, search_posts)

urlpatterns = [
    url(r'search_posts/',search_posts),
    url(r'delete_all_objects/',delete_all_objects),
    url(r'form_submit', submit),
    url(r'submit/',submit_ajax),
    url(r'^$',PostsListView.as_view(),name='list'),  # вывод списка постов
    url(r'^(?P<pk>\d+)/$', PostDetailView.as_view()),  # вывод поста с определенным номером
]
コード例 #6
0
ファイル: urls.py プロジェクト: yamila-moreno/PyConES-2015
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView

from blog.views import PostsListView, PostDetailsView, PostsTagListView, PostsFeed, PostsAtomFeed


urlpatterns = [
    url(r'^$', PostsListView.as_view(), name="list"),
    url(r'^feed/', PostsFeed(), name="blog_feed"),
    url(r'^atom/', PostsAtomFeed(), name="blog_atom"),
    url(r'^rss/', RedirectView.as_view(url=reverse_lazy('blog_feed'))),
    url(r'^tag/(?P<slug>.+)/$', PostsTagListView.as_view(), name="posts_tag"),
    url(r'^(?P<slug>.+)/$', PostDetailsView.as_view(), name="post"),
]
コード例 #7
0
from django.conf.urls import url

from blog.views import PostsListView, PostDetailView  # импортируем варианты отображения

urlpatterns = [
    url(r'^$', PostsListView.as_view(),
        name='list'),  # первое отображение список постов
    url(r'^(?P<pk>\d+)/$',
        PostDetailView.as_view()),  # второе - детальное отображение поста
]
コード例 #8
0
from rest_framework.routers import DefaultRouter

from blog.api import BlogsAPI, PostsViewSet
from blog.views import PostsListView, BlogsListView, BlogUserView, PostUserDetail, NewPostView
from users.views import LoginView, Register, LogoutView
from users.api import UserViewSet

router = DefaultRouter()
router.register("posts", PostsViewSet)

router = DefaultRouter()
router.register('users', UserViewSet)

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', PostsListView.as_view(), name='posts_list'),
    url(r'^blogs/$', BlogsListView.as_view(), name='blogs_list'),
    url(r'^blogs/(?P<username>[-\w]+)/$',
        BlogUserView.as_view(),
        name='blog_user'),
    url(r'^blogs/(?P<username>[-\w]+)/(?P<post_pk>[0-9]+)$',
        PostUserDetail.as_view(),
        name='post_user_detail'),
    url(r'new-post/$', NewPostView.as_view(), name="post_new"),

    # Users URLS
    url(r'^login$', LoginView.as_view(), name='users_login'),
    url(r'^logout$', LogoutView.as_view(), name='users_logout'),
    url(r'^signup$', Register.as_view(), name='register'),

    # API Users
コード例 #9
0
from django.conf.urls import url, include
from django.contrib import admin

from django.views.generic.base import RedirectView

from blog.views import PostsListView, PostDetailView, About, PostsListFilteredByTagView

urlpatterns = [
    # for search. used haystack+whoosh
    url(r'^search/', include('haystack.urls')),

    # ex. localhost:8000/
    url(r'^$', PostsListView.as_view(), name='index_list'),

    #
    url(r'^blog/page/(?P<page>\d+)/$', PostsListView.as_view(), name='pages'),

    # http://localhost:8000/blog/category/python/
    url(r'blog/category/([\d\w\-]+)/$',
        PostsListFilteredByTagView.as_view(),
        name='filter_posts'),

    # ex. localhost:8000/about/
    url(r'about/$', About.as_view(), name='about'),

    # http://localhost:8000/blog/2016/2/16/python-django-haystack/
    url(r'^blog/\d+/\d+/\d+/(?P<slug>[\d\w\-]+)/$', PostDetailView.as_view()),

    # for admin part of site
    url(r'^admin/', admin.site.urls),
コード例 #10
0
from django.conf.urls import patterns, url

from blog.views import PostsListView, PostDetailView, About

urlpatterns = [
    url(r'^$', PostsListView.as_view(), name='index_list'),
    url(r'^page/(?P<page>\d+)/$', PostsListView.as_view(), name='pagination'),
    url(r'about/$', About.as_view(), name='about'),
    url(r'^(?P<slug>[\d\w\-]+)/$', PostDetailView.as_view()),
]
コード例 #11
0
ファイル: urls.py プロジェクト: romanyakovlev/my_project
# -*- coding: utf-8 -*-

from django.conf.urls import *

from blog.views import (PostsListView, PostDetailView, submit_ajax, submit,
                        delete_all_objects, search_posts)

urlpatterns = [
    url(r'search_posts/', search_posts),
    url(r'delete_all_objects/', delete_all_objects),
    url(r'form_submit', submit),
    url(r'submit/', submit_ajax),
    url(r'^$', PostsListView.as_view(), name='list'),  # вывод списка постов
    url(r'^(?P<pk>\d+)/$',
        PostDetailView.as_view()),  # вывод поста с определенным номером
]
コード例 #12
0
ファイル: urls.py プロジェクト: Jules-7/blog
from django.conf.urls import include, url
from blog.views import CategoriesListView, PostsListView, CategoriesDetailView, PostsDetailView

urlpatterns = [
    url(r'^ckeditor/', include('ckeditor.urls')),
    url(r'^category/$', CategoriesListView.as_view(), name="categories_list"),
    url(r'^post/$', PostsListView.as_view(), name="posts_list"),

    url(r'^category/(?P<slug>[-\w]+)$', CategoriesDetailView.as_view(), name="category_detail"),
    url(r'^post/(?P<slug>[-\w]+)$', PostsDetailView.as_view(), name="post_detail"),
]
コード例 #13
0
ファイル: urls.py プロジェクト: K-DOT/mysite
# coding: utf-8
from django.conf.urls import patterns, url

from blog.views import PostsListView, PostDetailView

urlpatterns = patterns(
    "blog.views",
    url(r"^$", PostsListView.as_view(), name="list"),  # то есть по URL http://имя_сайта/blog/
    # будет выводиться список постов
    url(r"^(?P<pk>\d+)/$", PostDetailView.as_view()),  # а по URL http://имя_сайта/blog/число/
    # будет выводиться пост с определенным номером
    url(r"^category/(?P<id>\d+)$", "category", name="url_category"),
)
コード例 #14
0
ファイル: urls.py プロジェクト: AlexKilimenniy/TestProject
from django.conf.urls import url
from blog.views import PostsListView, PostCreateView, CommentCreateView

urlpatterns = [
    url(r'^$', PostsListView.as_view(), name='blog'),
    url(r'^post/create/$', PostCreateView.as_view(), name='create_post'),
    url(r'^comment/add/(?P<pk>-?\d+)/$',
        CommentCreateView.as_view(),
        name='new_comment'),
]
コード例 #15
0
from django.conf.urls import include, url
from blog.views import CategoriesListView, PostsListView, CategoriesDetailView, PostsDetailView

urlpatterns = [
    url(r'^ckeditor/', include('ckeditor.urls')),
    url(r'^category/$', CategoriesListView.as_view(), name="categories_list"),
    url(r'^post/$', PostsListView.as_view(), name="posts_list"),
    url(r'^category/(?P<slug>[-\w]+)$',
        CategoriesDetailView.as_view(),
        name="category_detail"),
    url(r'^post/(?P<slug>[-\w]+)$',
        PostsDetailView.as_view(),
        name="post_detail"),
]
コード例 #16
0
ファイル: urls.py プロジェクト: yusrom/rostov
#coding: utf-8
from django.conf.urls import *
from django.urls import path, include

from blog.views import PostsListView, PostDetailView

# urlpatterns = patterns('',
# url(r'^$', PostsListView.as_view(), name='list'), # то есть по URL http://имя_сайта/blog/
#                                                # будет выводиться список постов
# url(r'^(?P<pk>\d+)/$', PostDetailView.as_view()), # а по URL http://имя_сайта/blog/число/
#                                               # будет выводиться пост с определенным номером

# )
urlpatterns = [
    path(r'$', PostsListView.as_view(), name='list'),
    path(r'(?P<pk>\d+)/$', PostDetailView.as_view()),
]
コード例 #17
0
ファイル: urls.py プロジェクト: grydinywka/yukon_test
from django.urls import path, re_path
from django.views.generic import TemplateView
from blog.views import PostsListView, PostDetailView, PostCreateView,\
                       PostUpdateView, PostDeleteView

app_name = "blog"
urlpatterns = [
    path('', PostsListView.as_view(), name='posts'),
    path('<int:pk>/', PostDetailView.as_view(), name='post_detail'),
    path('create/', PostCreateView.as_view(), name='post_create'),
    path('<int:pk>/update/', PostUpdateView.as_view(), name='post_update'),
    path('<int:pk>/delete/', PostDeleteView.as_view(), name='post_delete'),
]
コード例 #18
0
ファイル: urls.py プロジェクト: redbonesmith/django.example
from django.conf.urls import patterns, url

from blog.views import PostsListView, PostDetailView

urlpatterns = patterns(
    "",
    url(r"^$", PostsListView.as_view(), name="list"),  # http://name/blog/
    url(r"^(?P<pk>\d+)/$", PostDetailView.as_view()),
    # URL http://name/blog/{some number}/ <= post with defined number
)
コード例 #19
0
from django.conf.urls import url
from django.urls import path, re_path, include
from . import views
from blog.views import PostsListView, PostDetailView
from django.conf.urls.static import static
from django.conf import settings


app_name = 'blog'

urlpatterns = [
    url(r'^$', PostsListView.as_view(), name='posts-list'),
    url(r'^accounts/', include('allauth.urls')),
    re_path(r'^(?P<slug>\w+)/$', PostsListView.as_view(), name='posts-list'),
    path('post/<slug:slug>/', PostDetailView.as_view(), name='post-detail'),

    path('post/<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'),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
コード例 #20
0
    PostsLoadMoreView,
    PostSearchView,
)


sitemaps = {"posts": PostSitemap, "static": StaticSitemap}

urlpatterns = [
    path(f"{settings.ADMIN_URL}/", admin.site.urls),
    path("martor/", include("martor.urls")),
    path(
        "sitemap.xml",
        sitemap,
        {"sitemaps": sitemaps},
        name="django.contrib.sitemaps.views.sitemap",
    ),
    path("", cache_page(60 * 60)(PostsListView.as_view()), name="post_list"),
    path("search/", PostSearchView.as_view(), name="search"),
    path("more-posts/", PostsLoadMoreView.as_view(), name="more_posts"),
    path("about-me/", cache_page(60 * 60)(AboutMeView.as_view()), name="about_me"),
    path(
        "<slug:slug>/",
        cache_page(60 * 60)(PostDetailView.as_view()),
        name="post_detail",
    ),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


if settings.DEBUG:
    urlpatterns += staticfiles_urlpatterns()
コード例 #21
0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView

from blog.views import PostsListView, PostDetailsView, PostsTagListView, PostsFeed, PostsAtomFeed

urlpatterns = [
    url(r'^$', PostsListView.as_view(), name="list"),
    url(r'^feed/', PostsFeed(), name="blog_feed"),
    url(r'^atom/', PostsAtomFeed(), name="blog_atom"),
    url(r'^rss/', RedirectView.as_view(url=reverse_lazy('blog_feed'))),
    url(r'^tag/(?P<slug>.+)/$', PostsTagListView.as_view(), name="posts_tag"),
    url(r'^(?P<slug>.+)/$', PostDetailsView.as_view(), name="post"),
]
コード例 #22
0
#coding: utf-8
from django.conf.urls import patterns, url
from blog.models import Post

from blog.views import PostsListView, PostDetailView

urlpatterns = patterns('blog.views',
url(r'^$', PostsListView.as_view(queryset=Post.objects.all().order_by('-datetime')), name='list'),
url(r'^(?P<pk>\d+)/$', PostDetailView.as_view()),
url(r'^tag/(?P<id>\w+)/$', 'tag')

)
コード例 #23
0
ファイル: urls.py プロジェクト: ZendljRp/cubledotes
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

"""
from __future__ import unicode_literals

from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView

from blog.views import PostsListView, PostDetailsView, PostsTagListView, PostsFeed, PostsAtomFeed


urlpatterns = patterns(
    '',
    url(r'^$', PostsListView.as_view(), name="blog"),

    url(r'^feed/', PostsFeed(), name="blog_feed"),
    url(r'^atom/', PostsAtomFeed(), name="blog_atom"),
    # Redirecciones
    url(r'^rss/', RedirectView.as_view(url=reverse_lazy('blog_feed'))),

    url(r'^tag/(?P<slug>.+)/$', PostsTagListView.as_view(), name="posts_tag"),
    url(r'^(?P<slug>.+)/$', PostDetailsView.as_view(), name="post"),

)

コード例 #24
0
#coding: utf-8
from django.conf.urls import *
from blog.views import PostsListView, PostDetailView, category


urlpatterns = [
url(r'^$', PostsListView.as_view(), name='list'), # то есть по URL http://имя_сайта/blog/
                                               # будет выводиться список постов
url(r'^(?P<pk>\d+)/$', PostDetailView.as_view(), name=''), # а по URL http://имя_сайта/blog/число/
                                              # будет выводиться пост с определенным номером


url(r'^category/(?P<slug>[-\w]+)/$', category, name='category'),

]
コード例 #25
0
ファイル: urls.py プロジェクト: pythonvlc/PyConES-2015
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView

from blog.views import PostsListView, PostDetailsView, PostsTagListView, PostsFeed, PostsAtomFeed

urlpatterns = patterns(
    '',
    url(r'^$', PostsListView.as_view(), name="blog"),
    url(r'^feed/', PostsFeed(), name="blog_feed"),
    url(r'^atom/', PostsAtomFeed(), name="blog_atom"),
    url(r'^rss/', RedirectView.as_view(url=reverse_lazy('blog_feed'))),
    url(r'^tag/(?P<slug>.+)/$', PostsTagListView.as_view(), name="posts_tag"),
    url(r'^(?P<slug>.+)/$', PostDetailsView.as_view(), name="post"),
)
コード例 #26
0
ファイル: urls.py プロジェクト: manny1407/example
#coding: utf-8
from django.conf.urls import patterns, url

from blog.views import PostsListView, PostDetailView

urlpatterns = patterns('',
url(r'^$', PostsListView.as_view(), name='list'), # то есть по URL http://имя_сайта/blog/
                                               # будет выводиться список постов
url(r'^(?P<pk>\d+)/$', PostDetailView.as_view()), # а по URL http://имя_сайта/blog/число/
                                              # будет выводиться пост с определенным номером

)
コード例 #27
0
ファイル: urls.py プロジェクト: noob-saibot/djp
#coding: utf-8
from django.conf.urls import *
from django.views.generic import TemplateView
from blog.views import PostsListView, PostDetailView, Tree, Notes, WikiPostDetail, ChartsDetail, ChartsList

urlpatterns = [
    url(r'^$', Tree.as_view(), name='tree'),
    url(r'^gr/$', ChartsList.as_view(), name='charts_list'),
    url(r'^gr/(?P<pk>\d+)/$', ChartsDetail.as_view(), name='charts_detail'),
    url(r'^main/$', PostsListView.as_view(), name='list'),
    url(r'^main/(?P<pk>\d+)/$', PostDetailView.as_view()),
    url(r'^api/$', Notes),
]