Ejemplo n.º 1
0
from django.urls import path, re_path
# from blog.views import index
from blog.views import indexPage, PostListView, PostFormView, search_code, view_by_cat_button, BtnBlogDetails, ContactFormView, post_edit_form_view, PostDetailsView, PostFormUpdateView, PostFormDeleteView

urlpatterns = [
    # path("index", indexPage),
    path("",
         PostListView.as_view(template_name="blog/index.html"),
         name="index"),
    # path("<int:id>", post_details),
    # path("<int:pk>", PostDetailsView.as_view()),
    path("posts",
         PostFormView.as_view(template_name="blog/post.html"),
         name="post"),
    # path("posts", post_form_view),
    path("search/", search_code, name="search"),
    path("contact",
         ContactFormView.as_view(template_name="blog/contact.html"),
         name="contact"),
    path("filter/<int:id>", view_by_cat_button),
    path("filter/<slug:slug>", BtnBlogDetails.as_view()),
    path("<slug:slug>", PostDetailsView.as_view(), name="post-detail"),
    path("posts/<slug:slug>", PostFormUpdateView.as_view(),
         name="update-blog"),
    path(
        "delete/<slug:slug>",
        PostFormDeleteView.as_view(),
        name="delete-blog",
    )
]
Ejemplo n.º 2
0
from django.conf.urls import patterns, include, url

from blog.views import PostListView, PostDetailView, like

urlpatterns = patterns('',
    url(r'^$', PostListView.as_view(), name='list'),
    url(r'^likes/$', like, name='like'),
    url(r'^post/(?P<pk>\d+)/$', PostDetailView.as_view(), name='detail'),
    url(r'^page/(?P<page>[0-9]+)/$', PostListView.as_view(), name='paginate_list'),
    url(r'^category/(?P<pk>\d+)/$', PostListView.as_view(categorised = True), name='Categorise_list'),
    url(r'^category/(?P<pk>\d+)/page/(?P<page>[0-9]+)/$', PostListView.as_view(categorised = True), name='list'),
)
Ejemplo n.º 3
0
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'),
        ]))
]
Ejemplo n.º 4
0
from blog.views import PostListView, PostDetailView
from galleries.views import GalleryListView, GalleryDetailView
from art.views import ArtworkDetailView
from tags.views import TagListView, TagDetailView
from .views import HomepageView
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', HomepageView.as_view(), name='index'),

    # Exhibition Views
    url(r'^exhibitions/$', ExhibitionListView.as_view(), name="exhib_list"),
    url(r'^exhibitions/(?P<slug>[-\w]+)/$', ExhibitionDetailView.as_view(), name="exhib_detail"),

    # Blog Views
    url(r'^journey/$', PostListView.as_view(), name="blog_list"),
    url(r'^journey/(?P<slug>[-\w]+)/$', PostDetailView.as_view(), name="blog_detail"),

    # Gallery Views
    url(r'^galleries/$', GalleryListView.as_view(), name="gal_list"),
    url(r'^galleries/(?P<slug>[-\w]+)/$', GalleryDetailView.as_view(), name="gal_detail"),
    url(r'^galleries/artwork/(?P<slug>[-\w]+)/$', ArtworkDetailView.as_view(), name="art_detail"),

    # TinyMCE
    url(r'^tinymce/', include('tinymce.urls')),
    # Media
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT,}),
    # Admin
    url(r'^admin/', include(admin.site.urls)),
    url(r'^admin_tools/', include('admin_tools.urls')),
)
Ejemplo n.º 5
0
#coding: utf-8
from django.conf.urls import patterns, url
from blog.views import PostListView, PostDetailView

urlpatterns = patterns('blog.views',
                       url(r'^$', PostListView.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'),

                       url(r'^tag/(?P<id>\d+)/$', 'tag'),
)
Ejemplo n.º 6
0
from django.contrib.auth.decorators import login_required
from django.urls import path

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

app_name = BlogConfig.name
urlpatterns = [
    path(r'', PostListView.as_view(), name='index'),
    path(r'post/<int:pk>/', PostDetailView.as_view(), name='post'),
    path(r'post/upload/',
         login_required(PostCreateView.as_view()),
         name='upload'),
    path(r'post/remove/<int:post_id>/',
         login_required(views.remove),
         name='remove'),
    path(r'post/edit/<int:pk>/',
         login_required(PostUpdateView.as_view()),
         name='edit'),
]
Ejemplo n.º 7
0
from django.conf.urls import include, url
from . import views
from blog.views import PostListView

urlpatterns = [
    #url(r'^$', views.post_list),  # first page with all post
    url(r'^$', PostListView.as_view(), name='post_list'),  # first page with all post
    url(r'^home/$', views.home, name='home'),  # HOME
    url(r'^about/$', views.about, name='about'),  # About page
    url(r'^works/$', views.works, name='works'),  # Portfolio
    url(r'^blog/$', PostListView.as_view(), name='post_list'),  # Blog
    url(r'^activate/(?P<key>.+)$', views.activation, name='activation'),
    url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail),  # page with a post detail
    url(r'^post/new/$', views.post_new, name='post_new'),  # insert new post
    url(r'^post/(?P<pk>[0-9]+)/edit/$', views.post_edit, name='post_edit'),  # edit a post
    url(r'^drafts/$', views.post_draft_list, name='post_draft_list'),  # list post without publish
    url(r'^post/(?P<pk>\d+)/publish/$', views.post_publish, name='post_publish'),  # publish a post in the draft list
    url(r'^post/(?P<pk>\d+)/remove/$', views.post_remove, name='post_remove'),  # remove a post
    url(r'^post/(?P<pk>\d+)/comment/$', views.add_comment_to_post, name='add_comment_to_post'),  # add comment to post
    url(r'^comment/(?P<pk>\d+)/approve/$', views.comment_approve, name='comment_approve'),  # approve a comment as admin user
    url(r'^comment/(?P<pk>\d+)/remove/$', views.comment_remove, name='comment_remove'),  # delete a comment as admin user
    url(r'^register/$', views.add_user, name='add_user'),  # insert new post
    url(r'^list/$', views.list, name='list'),  # cargar foto de usuario
    url(r'^contact/$', views.contact, name='contact_form'),  # cargar foto de usuario
    url(r'^list/(?P<pk>\d+)/remove/$', views.photo_remove, name='photo_remove'),  # delete a comment as admin user
    url(r'^profile/(?P<pk>\d+)/$', views.view_user_profile, name='view_user_profile'),  # views.view_user_profile es el método en views.py
    url(r'^profile/(?P<pk>\d+)/remove/$', views.delete_user_profile, name='delete_user_profile'),
    url(r'^search/$', views.search, name='searchentry'),
    # views.delete_user_profile es el método en views.py. Al tener pk en la URL debemos pasarla en el HTML (template)
]
Ejemplo n.º 8
0
from django.conf.urls import patterns, include, url
from django.contrib import admin

from blog.views import PostListView

admin.autodiscover()
urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'testblog.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls) ),
    url(r'^accounts/', include('accounts.urls', namespace='accounts') ),
    url(r'^blog/', include('blog.urls', namespace='blog') ),
    url(r'^$', PostListView.as_view(), name='frontpage')
)
Ejemplo n.º 9
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'),
]
Ejemplo n.º 10
0
from django.conf.urls import url
from blog.views import PostListView, CreatePostView

urlpatterns = [
    url('^list', PostListView.as_view()),
    url('^create', CreatePostView.as_view())
]
Ejemplo n.º 11
0
from django.urls import path
from blog.views import PostListView, PostDetailView, create_post, delete_post

app_name = 'blogs'

urlpatterns = [
    path("blog/", PostListView.as_view(), name='post_list'),
    path('blog/<int:pk>/', PostDetailView.as_view(), name='post_detail'),
    path('blog/create/', create_post, name='create_post'),
    path('blog/<int:id>/delete', delete_post, name='delete_post'),
]
Ejemplo n.º 12
0
 def test_index_GET(self):
   self.assertEqual(
     resolve(self.home_url).func.__name__,
     PostListView.as_view().__name__
   )
Ejemplo n.º 13
0
    url(r'^shop/orders/$', NewOrderView.as_view(template_name='order.html')),
    url(r'^home/$', HomePageView.as_view()),
    url(r'^blog/$', BlogPostListView.as_view()),
    url(r'^blog/page(?P<page>[0-9]+)/$', BlogPostListView.as_view()),
    url(r'^blog/(?P<pk>\d+)$', BlogPostDetailView.as_view()),
    url(r'^purchase/$', SinglePageView.as_view(template_name='singlepage.html', kw='purchase')),
    url(r'^thanks/$', SinglePageView.as_view(template_name='singlepage.html', kw='thanks')),
    url(r'^fail/$', SinglePageView.as_view(template_name='singlepage.html', kw='fail')),    
    url(r'^blog/tag/(?P<tag>\D+)/$', BlogPostTagListView.as_view(template_name='blogpost_list.html')),
    url(r'^blog/posts/(?P<pk>\d+)/$', BlogPostDetailView.as_view(template_name='blogpost_detail.html')),
    url(r'^photoalbum/$', PhotoAlbumView.as_view()),
    url(r'^photoalbum/tag/(?P<tag>\D+)/$', PhotoAlbumTagView.as_view()),
    url(r'^gallery/', include('photologue.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^(?P<slug>\w+)/page/$', SinglePageSidebarView.as_view()),
    url(r'^(?P<cat>\w+)/(?P<pk>\d+)$', PostDetailView.as_view()),
    #url(r'^\w+/(?P<pk>\d+)/$', PostDetailView.as_view()),
    url(r'^(?P<cat>\S+)/list/$',  PostListView.as_view(template_name='newpost_list.html')),
    url(r'^(?P<cat>\S+)/poems/$',  PostListView.as_view(template_name='poetry_list.html', paginate_by=12)),    
    url(r'^(?P<cat>\S+)/list/page(?P<page>[0-9]+)/$', PostListView.as_view(template_name='newpost_list.html')),
    url(r'^(?P<cat>\S+)/poems/page(?P<page>[0-9]+)/$', PostListView.as_view(template_name='poetry_list.html')),
    url(r'^(?P<cat>\w+)/$',  CatListView.as_view(template_name='cat_list.html', paginate_by=4)),
    url(r'^(?P<cat>\S+)/page(?P<page>[0-9]+)/$', PostListView.as_view(template_name='cat_list.html')),
    
    url(r'^gallery/photo/(?P<id>\S+)/buy/(?P<item>\w+)/$', OrderFormView.as_view(template_name='photo_buy.html'), name='buy'),
    url(r'^gallery/photo/(?P<id>\S+)/buy/(?P<item>\w+)/success/$', OrderView.as_view(template_name='photo_buy_success.html'), name='buy-success'),
    url(r'^grappelli/', include('grappelli.urls')),
)


Ejemplo n.º 14
0
from django.conf.urls.defaults import *

from blog.views import PostListView, PostDetailView

urlpatterns = patterns(
    "",
    url(r"^$", PostListView.as_view(), name="post_list"),
    url(r"^(?P<year>\d{4})/(?P<slug>.+)/$", PostDetailView.as_view(), name="post_detail"),
)
Ejemplo n.º 15
0
from django.urls import path
from blog.views import PostListView,PostDetailView,home, CreatePostView, delete_post,showProfileView, UpdatePostView,AddCategorieView,sameCategorieList,categorieListView,like_view,AddCommentView

app_name = 'blogs'

urlpatterns = [
    path("",home,name='home'),
    path('blog/',PostListView.as_view(),name='post_list'),
    path('blog/<int:pk>/',PostDetailView.as_view(),name='post_detail'),
    path('blog/create/', CreatePostView.as_view(), name='create_post'),
    path('blog/<int:id>/delete/', delete_post, name='delete_post'),
    path('blog/update/<int:pk>', UpdatePostView.as_view(), name='update_post'),
    path('blog/add_categorie/', AddCategorieView.as_view(), name='add_categorie'),
    path('blog/categorie/<str:cats>/', sameCategorieList, name='same_categorie_list'),
    path('blog/categorie_list/', categorieListView, name='categorie_list'),
    path('blog/like/<int:pk>', like_view, name='like_view'),
    path('blog/<int:pk>/add_comment/',AddCommentView.as_view(), name ='add_comment_section'),
    path('blog/<int:pk>/author_profile', showProfileView.as_view(), name='showProfileView')
    


]
Ejemplo n.º 16
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")
Ejemplo n.º 17
0
from django.urls import path
from blog.views import PostListView, PostDetailView

urlpatterns = [
    path("", PostListView.as_view(), name='blog-home'),
    path("post/<int:pk>", PostDetailView.as_view(), name="post-detail"),

]
Ejemplo n.º 18
0
from django.urls import path
from blog.views import PostListView, PostDetailView

from blog import views

app_name = 'blog'

urlpatterns = [
    path(r'', PostListView.as_view(), name='post_list'),
    path('new/', views.post_new, name='post_new'),
    path('<slug:slug>', PostDetailView.as_view(), name='post_detail'),
    path('edit/<slug:slug>', views.post_edit, name='post_edit'),
    path('remove/<slug:slug>', views.post_remove, name='post_remove'),
    path('comment/<slug:slug>', views.post_comment, name='post_comment'),
    path('tag/<int:pk>', views.tag_search_result, name='tag_search_result'),
    path('search/', views.search, name='search'),
]
Ejemplo n.º 19
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'),
]
Ejemplo n.º 20
0
Archivo: urls.py Proyecto: sanjuop/blog
from django.urls import path
from blog import views
from blog.views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, UserPostListView

urlpatterns = [
    path('', PostListView.as_view(), name="blog_home"),
    path('post/<int:pk>/', PostDetailView.as_view(), name='post_detail'),
    path('user/<str:username>/', UserPostListView.as_view(),
         name='user_posts'),
    path('post/new/', 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/', views.about, name="blog_about")
]
Ejemplo n.º 21
0
from django.conf.urls.defaults import patterns, include, url
from blog.views import PostListView, PostView
from blog.models import Post, NewsPost, PhotoPost, VideoPost, QuotePost, Tag
import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', PostListView.as_view(model=Post)),
    
    url(r'^news/(?P<pk>\d+)/?', PostView.as_view(model=NewsPost, template_name="blog/post_detail.html")),
    url(r'^photos/(?P<pk>\d+)/?', PostView.as_view(model=PhotoPost, template_name="blog/post_detail.html")),
    url(r'^videos/(?P<pk>\d+)/?', PostView.as_view(model=VideoPost, template_name="blog/post_detail.html")),
    url(r'^quotes/(?P<pk>\d+)/?', PostView.as_view(model=QuotePost, template_name="blog/post_detail.html")),

    url(r'^news/?', PostListView.as_view(model=NewsPost, queryset=NewsPost.objects.all(), template_name="blog/post_list.html")),
    url(r'^photos/?', PostListView.as_view(model=PhotoPost, queryset=PhotoPost.objects.all(), template_name="blog/post_list.html")),
    url(r'^videos/?', PostListView.as_view(model=VideoPost, queryset=VideoPost.objects.all(), template_name="blog/post_list.html")),
    url(r'^quotes/?', PostListView.as_view(model=QuotePost, queryset=QuotePost.objects.all(), template_name="blog/post_list.html")),

    url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
        'document_root': settings.MEDIA_ROOT,
    }),

    # Examples:
    # url(r'^$', 'topplr.views.home', name='home'),
    # url(r'^topplr/', include('topplr.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
Ejemplo n.º 22
0
# })

from rest_framework.routers import DefaultRouter, SimpleRouter

# give you a api root
router1 = DefaultRouter()
# router1 = SimpleRouter()

router1.register("post", PostViewSet)

# give you a api root
router2 = DefaultRouter()
# router1 = SimpleRouter()

router2.register("users", UserSetView)

urlpatterns = [
    path('user/', include(router.urls)),
    # path('posts/',posts),
    # path('post/<int:id>/',post_detail),
    path('posts/', PostAPIView.as_view()),
    path('post/<int:id>/', PostDetailAPIView.as_view()),
    path('generics/posts/', PostListView.as_view()),
    path('generics/posts/<int:id>/', PostListView.as_view()),
    path('postviewset/', include(router1.urls)),

    # path('userfilter/',UserListView.as_view()),
    path('userfilter/', include(router2.urls)),
    path('upload/', UploadView.as_view()),
]
Ejemplo n.º 23
0
from django.conf.urls import url
from django.views.generic import DetailView
from blog.models import Post, Category
from blog.views import CategoryListView, PostListView

urlpatterns = [
    # Index
    url(r'^(?P<page>\d+)?/?$', PostListView.as_view(
        model=Post,
        paginate_by=5,
        ),
        name='index'
    ),

    # Individual post
    url(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$', DetailView.as_view(
        model=Post,
        ),
        name='post'
    ),

    # Categories
    url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/?$', CategoryListView.as_view(
        paginate_by=5,
        model=Category,
        ),
        name='category'
    ),
]
Ejemplo n.º 24
0
from django.contrib import admin
from django.conf import settings
from django.conf.urls import patterns, include, url

import fancypages.urls
from fancypages import views

from blog.views import PostDetailView, PostListView

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^$', views.HomeView.as_view(), name='home'),
    url(r'^posts/$', PostListView.as_view(), name="post-list"),
    url(r'^posts/(?P<slug>[\w-]+)/$',
        PostDetailView.as_view(),
        name="post-detail"),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include(fancypages.urls)),
)

if settings.DEBUG:
    urlpatterns += patterns(
        '',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
        }),
    )
Ejemplo n.º 25
0
"""freetorial URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/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. 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 include, url
from django.contrib import admin

from django.views.generic import TemplateView

from blog.views import PostListView


urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),

    url(r'^$', PostListView.as_view() , name='index'),

    url(r'^blog/', include('blog.urls')),
]
Ejemplo n.º 26
0
"""

    blog.urls
    =========

"""
from django.conf.urls import patterns, url

from blog.views import PostListView, PostDetailView


urlpatterns = patterns('',
    url(r'^', PostListView.as_view(), name="list"),
    url(r'^/(?P<slug>[\w-]+)/$', PostDetailView.as_view(), name="detail"),
)
Ejemplo n.º 27
0
from django.urls import path, include
from blog.views import (HomeView, PostListView, PostLikeRedirect,
                        PostFavoriteRedirect, PostCreateView, PostUpdateView,
                        PostDetailView, PostDeleteView)

from users.views import removeFav

urlpatterns = [
    path('<slug:slug>/', HomeView.as_view(), name="post-filter"),
    path('', HomeView.as_view(), name="blog-home"),
    path('post/myposts/', PostListView.as_view(), name="my-posts"),
    path('post/new/', PostCreateView.as_view(), name="post-create"),
    path('post/<slug:slug>/comment/', include(("comments.urls", "comments"))),
    path('post/<slug:slug>/like', PostLikeRedirect.as_view(), name="likes"),
    path('post/<slug:slug>/favorite',
         PostFavoriteRedirect.as_view(),
         name="favorite"),
    path('post/<slug:slug>/update/',
         PostUpdateView.as_view(),
         name="post-update"),
    path('post/<slug:slug>/delete/',
         PostDeleteView.as_view(),
         name="post-delete"),
    path('post/<slug:slug>/', PostDetailView.as_view(), name="post-detail"),
    path('profile/<slug:slug>/favorite', removeFav, name="rem-fav"),
    # path('about/', AboutView.as_view(), name="blog-about"),
]
Ejemplo n.º 28
0
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from blog.views import (index, search, post_list, post_detail, post_create,
                        post_update, post_delete, IndexView, PostListView,
                        PostDetailView, PostCreateView, PostUpdateView,
                        PostDeleteView)

urlpatterns = [
    path('post_list/', PostListView.as_view(), name='post-list'),
    path('search/', search, name='search'),
    # path('create/', post_create, name='post-create'),
    path('create/', PostCreateView.as_view(), name='post-create'),
    # path('post/<id>/', post_detail, name='post-detail'),
    path('post/<pk>/', PostDetailView.as_view(), name='post-detail'),
    # path('post/<id>/update/', post_update, name='post-update'),
    path('post/<pk>/update/', PostUpdateView.as_view(), name='post-update'),
    # path('post/<id>/delete/', post_delete, name='post-delete'),
    path('post/<pk>/delete/', PostDeleteView.as_view(), name='post-delete'),
    path('tinymce/', include('tinymce.urls')),
]
Ejemplo n.º 29
0
from django.conf.urls.defaults import url, patterns
from blog.views import HomeView, PostListView, PostView, LoginView, AboutMe


urlpatterns = patterns(
    '',
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^login/$', LoginView.as_view(), {"login": True}, name='login'),
    url(r'^logout/$', LoginView.as_view(), {"login": False}, name='logout'),
    url(r'^blog/$', PostListView.as_view(), name='blog'),
    url(r'^blog/post/$', PostView.as_view(), name='new_post'),
    url(r'^blog/post/(?P<slug>[\w-]+)/$', PostView.as_view(), name='blog_post'),
    url(r'^about_me/$', AboutMe.as_view(), name='about_me'),
)
Ejemplo n.º 30
0
from django.urls import path
from blog.views import PostDetailView, PostListView, CategoryView, PostFormView, PostFormUpdateView

urlpatterns = [
    path("post/addpost", PostFormView.as_view()),
    path("posts/<slug:slug>", PostFormUpdateView.as_view()),
    path("", PostListView.as_view(), name="post-detail"),
    path("<slug:slug>", PostDetailView.as_view(), name="post-detail"),
    path("category/<category>",
         CategoryView.as_view(),
         name="post-detail-category"),
]
Ejemplo n.º 31
0
from django.urls import path
from blog.views import (
    post_list,
    post_detail,
    PostListView,
    send_email,
)

app_name = 'blog'

urlpatterns = [
    path('', post_list, name='post_list'),
    path('classpostview/', PostListView.as_view(), name='post_class_list'),
    path('<int:post_id>/', send_email, name='post_send'),
    path('<int:year>/<int:month>/<int:day>/<slug:post>',
         post_detail,
         name='post_detail'),
    path('tag/<slug:tag_slug>/', post_list, name='post_list_by_tag'),
]
Ejemplo n.º 32
0
from django.conf.urls import url
from . import views
from blog.views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView

urlpatterns = [
    #url('^$', views.home, name = 'blog-home'),
    url('^$', PostListView.as_view(), name='blog-home'),
    url('about/', views.about, name='blog-about'),
    url('post/(?P<pk>[0-9]+)/', PostDetailView.as_view(),
        name='post-detail'),  #url for specific post
    url('post/new/', PostCreateView.as_view(), name='post-create'),  #working
    url('post/(?P<pk>[0-9]+)/update/',
        PostUpdateView.as_view(),
        name='post-update'),
    url('post/(?P<pk>[0-9]+)/del/',
        PostDeleteView.as_view(),
        name='post-delete'),
]
#
Ejemplo n.º 33
0
from django.conf.urls import patterns, include, url
from django.conf import settings
from blog.views import PostListView

urlpatterns = patterns('',
    url(r'^$', PostListView.as_view(), name='post-list'),
    url(r'^post/', include('blog.urls')),
)

if settings.DEBUG:
	from django.contrib.staticfiles.urls import staticfiles_urlpatterns
	urlpatterns += staticfiles_urlpatterns()

	urlpatterns += patterns('',
			url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
				'document_root': settings.MEDIA_ROOT,
			}),
	   )
Ejemplo n.º 34
0
from django.conf.urls import url
from blog.views import PostListView, PostView, CommentListView, CommentView

urlpatterns = [
    url('posts', PostListView.as_view()),
    url('post/(?P<id>[0-9]+)', PostView.as_view()),
    url('post', PostView.as_view()),
    url('comments', CommentListView.as_view()),
    url('comment/(?P<id>[0-9]+)', CommentView.as_view()),
    url('comment', CommentView.as_view()),
]
Ejemplo n.º 35
0
from django.urls import path, include
from blog.views import PostListView, PostDetailView, PostCreateView



urlpatterns = [
    path('api/', include('api.urls')),
    path('', PostListView.as_view(), name='blog-list-page'),
    path('<str:slug>/', PostDetailView.as_view(), name='blog-details-page'),
    path('new', PostCreateView.as_view(), name='new-page'),
]
Ejemplo n.º 36
0
 def test_index_url(self):
     self.url = reverse('blog-home')
     self.assertEqual(
         resolve(self.url).func.__name__,
         PostListView.as_view().__name__)
Ejemplo n.º 37
0
    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
from django.contrib import admin
from typeidea.custom_site import custom_site

from blog.views import post_detail, PostListView
from config.views import LinkListView
from comment.views import CommentView

urlpatterns = [
    # 处理添加评论
    url(r'^comment/$', CommentView.as_view(), name='add_comment'),
    # 友链
    url(r'^links/$', LinkListView.as_view(), name='links'),
    url(r'^$', PostListView.as_view(), name='index'),
    url(r'^owner/(?P<owner_id>\d+)/$', PostListView.as_view(), name='owner_list'),
    url(r'^category/(?P<category_id>\d+)/$', PostListView.as_view(), name='category_list'),
    url(r'^tag/(?P<tag_id>\d+)/$', PostListView.as_view(), name='tag_list'),

    url(r'^post/(?P<post_id>\d+).html$', post_detail, name='post_detail'),


    url(r'^super_admin/', admin.site.urls, name='super_admin'),

    url(r'^admin/', custom_site.urls, name='admin'),
]
Ejemplo n.º 38
0
from django.conf.urls import patterns, include, url
from django.conf import settings
from blog.views import PostListView

urlpatterns = patterns("", url(r"^$", PostListView.as_view(), name="post-list"), url(r"^post/", include("blog.urls")))

if settings.DEBUG:
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns

    urlpatterns += staticfiles_urlpatterns()

    urlpatterns += patterns(
        "", url(r"^media/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT})
    )
Ejemplo n.º 39
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"),
]
Ejemplo n.º 40
0
"""Tournaments 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.urls import path, include
from blog.views import PostListView

urlpatterns = [
    path('', PostListView.as_view(), name='home'),
    path('admin/', admin.site.urls),
    path('tournaments/', include('tournaments_app.urls')),
    path('blog/', include('blog.urls')),
    path('user/', include('user.urls'))
]
Ejemplo n.º 41
0
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf import settings
admin.autodiscover()

from blog.views import PostListView, PostDetailView, PostNoTag, PostMonthView

urlpatterns = patterns('',
    url(r'^$', PostListView.as_view(), name='list'),
    url(r'^radio.mp3$', 'blog.views.radio', name='radio'),
    url(r'^random/$', 'blog.views.random'),
    url(r'^banner/$', 'blog.views.banner'),
    url(r'^notag/$', PostNoTag.as_view(), name='notag'),
    url(r'^(?P<pk>\d+)/$', PostDetailView.as_view(), name='post'), 
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$', PostMonthView.as_view(), name='monthly'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>\S+).html$', 'blog.views.doublerouble', name='slug'),
    url(r'^api/get_posts/(?P<page>\d+)/$', 'blog.views.get_posts'),
    url(r'^api/get_posts/(?P<page>\d+)/(?P<tag>\S+)/$', 'blog.views.get_posts'),
    url(r'^tag/(?P<tag>\S+)/$', PostListView.as_view(), name='list'),
    url(r'^search/label/(?P<tag>\S+)/$', PostListView.as_view()),

    # 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)),

    #url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'static'}),
    #url(r'^images/(?P<path>.*.jpg)$', 'django.views.static.serve', {'document_root': 'images'}),
Ejemplo n.º 42
0
from django.conf.urls import url

# from blog.views import index
from blog.views import PostListView, PostDetailListView, PostdetailListView, ArchivesListView,CategoriesListView, \
    PostDetailView,TagsListView,search, index, searchindex,index,PostDetailViewPrime

app_name = 'blog'

urlpatterns = [
    # url(r'^index/$',index,name='index'),
    url(r'^index/$', PostListView.as_view(), name='index'),
    # url(r'^post_detail/(?P<pk>\d+)', PostDetailListView, name='post_detail'),
    # url(r'^detail/(?P<pk>\d+)/$', PostdetailListView.as_view(), name='detail'),
    # url(r'^post_detail/(?P<pk>\d+)/', PostDetailView.as_view(), name='post_detail'),
    url(r'^post_detail/(?P<pk>\d+)/',
        PostDetailViewPrime.as_view(),
        name='post_detail'),
    url(r'^archives/(?P<year>\d{4})/(?P<month>\d{1,2})/$',
        ArchivesListView.as_view(),
        name='archives'),
    url(r'^categories/(?P<pk>\d+)',
        CategoriesListView.as_view(),
        name='categories'),
    # url(r'^tags/(?P<pk>\d+)', TagsListView.as_view(), name='tags'),
    url(r'^tags/(?P<pk>\d+)', TagsListView.as_view(), name='tags'),
    # url(r'^tags/(?P<pk>\d+)', tags, name='tags'),
    # url(r'^search/$',search,name='search'),
    url(r'^search_index/$', index, name='search_index'),
    # url(r'^search_index/$',searchindex.as_view(),name='search_index'),
]
Ejemplo n.º 43
0
from django.conf.urls import url
from blog.views import PostListView, PostListViewByTags, PostDetailView

urlpatterns = [
    url(r'^$', PostListView.as_view(), name='home'),
    url(r'^(?P<slug>[-_\w]+)', PostDetailView.as_view(), name='post_detail')
]
Ejemplo n.º 44
0
from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from blog.models import Post
from blog.views import PostListView



urlpatterns = [ 
                url(r'^$', PostListView.as_view(), name='PostListView'),
                url(r'^(?P<pk>\d+)$', DetailView.as_view(
                                    model = Post,
                                    template_name="blog/post.html")),
             ]
Ejemplo n.º 45
0
from django.conf.urls import patterns, include, url

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

urlpatterns = patterns('blog.views',
    url(r'^$', PostListView.as_view()),
    url(r'^all/$', PostSummaryView.as_view()),
    url(r'^new/$', 'edit_post'),
    url(r'^(?P<slug>[\w\-]+)/$', PostDetailView.as_view()),
    url(r'^(?P<slug>[\w\-]+)/edit/$', 'edit_post'),
)
Ejemplo n.º 46
0
from django.conf.urls import include, url
from blog.views import PostListView, PostDetailView

urlpatterns = [url(r"^$", PostListView.as_view(), name="list"), url(r"^(?P<pk>\d+)/$", PostDetailView.as_view())]
Ejemplo n.º 47
0
"""mysite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/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. 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 include, url
from django.contrib import admin
from blog.views import PostListView,PostDetailView,NewCommentView,NewBlogPostView,UpdateBlogPostView

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', PostListView.as_view(), name='post-list'),
    url(r'post/(?P<pk>\d+)/$', PostDetailView.as_view(), name='post-details'),
    url(r'new-comment/$', NewCommentView.as_view(), name='new-comment'),
    url(r'post/new/$', NewBlogPostView.as_view(), name='new-blog-post'),
    url(r'post/(?P<pk>\d+)/update/$', UpdateBlogPostView.as_view(), name='update-blog-post'),
]
Ejemplo n.º 48
0
#coding: utf-8
from django.conf.urls import url
from django.views.generic import ListView, DetailView
from blog.models import Post
from blog.views import PostListView, month, tagpage

app_name = 'blog'
urlpatterns = [
    url(r'^$', PostListView.as_view(queryset=Post.publics.all(), template_name='blog.html')),
    url(r'^blog/page(?P<page>\d+)/$', PostListView.as_view(queryset=Post.publics.all(), template_name='blog.html')),
    url(r'^(?P<pk>\d+)$', DetailView.as_view(model=Post, template_name='post_detail.html')),
    url(r'^archives/$', ListView.as_view(queryset=Post.publics.all(), template_name='archives.html')),
    url(r"^archives/(\d+)/(\d+)/$", month),
    url(r'^tag/(?P<tag>\w+)$', tagpage),
    # url(r'^projects/$', projects, name='projects'),
]
Ejemplo n.º 49
0
from django.contrib import admin
from django.conf import settings
from django.conf.urls import patterns, include, url

import fancypages.urls
from fancypages import views

from blog.views import PostDetailView, PostListView

admin.autodiscover()


urlpatterns = patterns(
    '',

    url(r'^$', views.HomeView.as_view(), name='home'),

    url(r'^posts/$', PostListView.as_view(), name="post-list"),
    url(r'^posts/(?P<slug>[\w-]+)/$', PostDetailView.as_view(),
        name="post-detail"),

    url(r'^admin/', include(admin.site.urls)),

    url(r'^', include(fancypages.urls)),
)

if settings.DEBUG:
    urlpatterns += patterns(
        '', url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
                {'document_root': settings.MEDIA_ROOT}))
Ejemplo n.º 50
0
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
from blog.views import AboutMe_TemplateView, PostDetailView, PostListView, CategoryListView
#namespace = 'blog'

urlpatterns = [
    path('about_me/', AboutMe_TemplateView.as_view(), name='aboutme'),
    path('', PostListView.as_view(), name="post_list"),
    path('<category>/', CategoryListView.as_view(), name="post_category"),
    path('post/<int:pk>/', PostDetailView.as_view(), name="post_detail"),
    path('programmming/',
         views.post_category_programming,
         name='post_category_programming'),
    path('cooking/', views.post_category_cooking,
         name='post_category_cooking'),
    path('post/new/', views.post_new, name='post_new'),
    path('post/<int:pk>/edit/', views.post_edit, name='post_edit'),
    path('post/<int:pk>/delete/', views.post_delete, name='post_delete'),
    path('login/',
         auth_views.LoginView.as_view(template_name='login.html'),
         name='login'),
]
Ejemplo n.º 51
0
from django.conf.urls import patterns, url

from blog.views import (PostListView,
                        PostDetailView,
                        PostYearArchiveView,
                        PostListByTag)

urlpatterns = patterns('',
    # Index view
    url(r'^$',
        PostListView.as_view(),
        name='blog',
        ),

    # Detail view
    url(r'^(?P<pub_year>\d{4})/(?P<pub_month>\w{3})/(?P<slug>[a-zA-Z0-9-]+)/$',
        PostDetailView.as_view(),
        name='blog-detail',
        ),

    # Yearly archive view
    url(r'^(?P<year>\d{4})/$',
        PostYearArchiveView.as_view(),
        name='blogarchive'
        ),

    # Category view
    url(r'^tags/(?P<tags>\w*)/$',
        PostListByTag.as_view(),
        name='blogtags',
        ),
Ejemplo n.º 52
0
from django.conf.urls import patterns, url

from blog.views import PostListView, PostCreateView

urlpatterns = patterns('',
	url(r'^$', PostListView.as_view(), name='post_list_view'),
	url(r'^create/$', PostCreateView.as_view(), name='post_create_view'),
)