Exemple #1
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from blog.views import PostList, PostDetail, PostCreate

urlpatterns = patterns(
    '',
    # Examples:
    url(r'^$', PostList.as_view(), name='home'),
    url(r'^(?P<pk>\d+)/$', PostDetail.as_view(), name='detail'),
    url(r'^create/$', PostCreate.as_view(), name='create'),
    # url(r'^blog/', include('blog.urls')),
    url(r'^admin/', include(admin.site.urls)),
)
Exemple #2
0
from django.urls import path
from blog.views import BlogHome, PostDetail, AuthorDetail, AuthorPosts
from blog.views import AuthorList, CreatePost, CreateComment, UpdateAuthor
from blog.views import UpdatePost

urlpatterns = [
    path('', BlogHome.as_view(), name='home'),
    path('post/<int:pk>/', PostDetail.as_view(), name='post-detail'),
    path('author/<int:pk>/', AuthorDetail.as_view(), name='author-detail'),
    path('posts/author/<int:pk>/', AuthorPosts.as_view(), name='author-posts'),
    path('authors/', AuthorList.as_view(), name='author-list'),
    path('post/create/', CreatePost.as_view(), name='create-post'),
    path('post/<int:pk>/comment/',
         CreateComment.as_view(),
         name='create-comment'),
    path('author/<int:pk>/update/',
         UpdateAuthor.as_view(),
         name='update-author'),
    path('post/<int:pk>/update/', UpdatePost.as_view(), name='update-post'),
]
from django.contrib import admin
from django.urls import path
from blog.views import PostsList, PostDetail, PostCreate, PostUpdate, PostDelete, PostsAdmin
from accounts.views import *
from django.conf import settings
from django.conf.urls.static import static
from . import views

urlpatterns = [
    path('posts/',
         PostsList.as_view(template_name="posts.html"),
         name='listpost'),
    path('posts/detail/<int:pk>',
         PostDetail.as_view(template_name="post-detail.html"),
         name='detailpost'),
    path('posts/admin/', views.PostsAdmin, name='postadmin'),
    path('posts/create',
         PostCreate.as_view(template_name="create-post.html"),
         name='createpost'),
    path('posts/edit/<int:pk>',
         PostUpdate.as_view(template_name="post-detail.html"),
         name='updatepost'),
    path('posts/delete/<int:pk>', PostDelete.as_view(), name='deletepost'),
]
Exemple #4
0
from blog.views import PostDetail, TagDetail
from django.urls import path
from .views import *

urlpatterns = [
    path('', posts_list, name='posts_list_url'),
    path('post/<str:slug>/', PostDetail.as_view(), name='post_detail_url'),
    path('tags/', tags_list, name='tags_list_url'),
    path('tag/<str:slug>/', TagDetail.as_view(), name='tag_detail_url'),
]
Exemple #5
0
from django.conf.urls import url
from blog.views import PostList, PostDetail

urlpatterns = [
    url(r'^(?P<slug>.+)', PostDetail.as_view()),
    url(r'^', PostList.as_view()),
]
Exemple #6
0
from django.urls import path, re_path
from blog.views import PostDetail, PostListView, PostShareView
from blog.views import PostDetail, PostListView, PostListPagination

urlpatterns = [
    path('', PostListView.as_view(), name='post_list'),
    re_path(
        r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<post>[-\w]+)/$',
        PostDetail.as_view(),
        name='post_detail'),
    re_path(r'^(?P<post_id>\d+)/share/$',
            PostShareView.as_view(),
            name='post_share'),
    re_path(r'^tag/(?P<tag_slug>[-\w]+)/$',
            PostListPagination.as_view(),
            name='post_list_by_tag'),
    path('pagination/',
         PostListPagination.as_view(),
         name='post_list_pagination'),
]
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)),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemple #8
0
 def setUp(self):
     self.factory = APIRequestFactory()
     self.view = PostDetail.as_view()
     self.url = lambda id: reverse("blog-post-detail", kwargs={"id": id})
Exemple #9
0
from django.conf.urls import patterns, url, include

from blog.views import PostList, PostDetail
from blog.views import TagList, TagDetail
from blog.views import AuthorList,AuthorDetail 

post_urls = patterns('',
	url(r'^myname/(?P<pk>\d+)/$', PostDetail.as_view(), name='post-detail'),
    url(r'^$', PostList.as_view(), name='post-list')
)

tag_urls = patterns('',
	url(r'^myname/(?P<pk>\d+)/$',TagDetail.as_view(), name='tag-detail'),
    url(r'^$', TagList.as_view(), name='tag-list')
)

author_urls = patterns('',
    url(r'^myname/(?P<pk>\d+)/$', AuthorDetail.as_view(), name='author-detail'),
    url(r'^$', AuthorList.as_view(), name='author-list')
)

user_urls = patterns(''
	url(r'^users/(?P<pk>)[0-9]+)/$', UserDetail.as_view(), name='user-detail')
	url(r'^users/$', UserList.as_view(), name='user-list'),




urlpatterns = patterns('',
	url(r'^s',include(post_urls)),
	url(r'^',include(tag_urls)),
Exemple #10
0
from django.urls import path
from blog.views import all_posts, single_post,new_post,edit_post, PostList, PostDetail, PostUpdate


app_name='blog'

urlpatterns = [
    path('', all_posts, name='blog_list'),
    path('new', new_post, name='new_post'),
    path('<int:id>', single_post, name='blog_detail'),
    path('<int:id>/edit', edit_post, name='post_edit'),
    
    path('cbv', PostList.as_view()),
    path('cbv/<int:pk>', PostDetail.as_view()),
    path('cbv/<int:pk>/edit', PostUpdate.as_view()),


]


Exemple #11
0
from django.conf.urls.static import static
from blog.views import PhotoListView, PhotoCreateView, PhotoDetailView, PhotoDeleteView, PhotoVoteToggle, PhotoSaveView, PostDetail, PersonalListView, PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView

urlpatterns = [
    path('', PostListView.as_view(), name='blog-home'),
    path('about/', views.about, name='blog-about'),
    path('download/<int:pk>/', views.download_image, name=('photo-download')),
    path('gallery/', PhotoListView.as_view(), name='gallery'),
    path('personal/', PersonalListView.as_view(), name='personal-saves'),
    path('gallery/<str:order>/', PhotoListView.as_view(),
         name='gallery-param'),
    path('new_post/', PhotoCreateView.as_view(), name='new_post'),
    path('post2/<int:pk>/', PostDetailView.as_view(), name='post2-detail'),
    path('post2/<int:pk>/update/',
         PostUpdateView.as_view(),
         name='post2-update'),
    path('post2/<int:pk>/delete/',
         PostDeleteView.as_view(),
         name='post2-delete'),
    path('post2/new/', PostCreateView.as_view(), name='post-create'),
    path('posts/<pk>/', PostDetail.as_view(), name='detail'),
    path('photos/<int:pk>/', PhotoDetailView.as_view(), name='photo-detail'),
    path('photos/<int:pk>/delete/',
         PhotoDeleteView.as_view(),
         name='photo-delete'),
    path('photos/<int:pk>/save/', PhotoSaveView.as_view(), name='photo-save'),
    path('photos/<int:pk>/motivate/',
         PhotoVoteToggle.as_view(),
         name='photo-vote')
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemple #12
0
from django.conf.urls import patterns, url
from blog.views import PostList, PostDetail


urlpatterns = patterns('',
    url(r'^$', PostList.as_view(), name='list'),
    url(r'^(?P<pk>\d+)/$', PostDetail.as_view()),
)
Exemple #13
0
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from blog.views import PostList, PostDetail, PostCreate, PostEdit, PostDelete
from django.contrib.auth.decorators import login_required

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

    # 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'post/create$', login_required(PostCreate.as_view()), name='post_create'),
    url(r'post/(?P<pk>\d+)/edit$', login_required(PostEdit.as_view()), name='post_edit'),
    url(r'post/(?P<pk>\d+)/delete$', login_required(PostDelete.as_view()), name='post_delete'),
    url(r'post/(?P<pk>\d+)/$', PostDetail.as_view(), name='post_detail'),
    url(r'^tinymce/', include('tinymce.urls')),

    url(r'^$', PostList.as_view(), name='post_list'),
)
Exemple #14
0
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from blog.views import PostList, PostDetail


urlpatterns = patterns(
    "", url(r"^$", PostList.as_view(), name="list"), url(r"^(?P<slug>[-_\w]+)/$", PostDetail.as_view(), name="detail")
)
Exemple #15
0
import autocomplete_light
# import every app/autocomplete_light_registry.py
autocomplete_light.autodiscover()

from django.conf.urls import patterns, include, url
from django.contrib import admin
from blog.views import PostDetail, PostList, AboutUs, HomeView
from item.views import ItemDetail, ItemList


urlpatterns = patterns('',
    # Examples:
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^autocomplete/', include('autocomplete_light.urls')),
    url(r'^item/$', ItemList.as_view(), name='item-list'),
    url(r'^item/(?P<slug>.+)/$', ItemDetail.as_view(), name='item-detail'),
    url(r'^blog/$', PostList.as_view(), name='post-list'),
    url(r'^blog/(?P<slug>.+)/$', PostDetail.as_view(), name='post-detail'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^about/$', AboutUs.as_view(), name='about-us'),
)
from django.conf.urls import url
from . import views
from blog.views import PostList, PostDetail, PostCreate, PostUpdate, PostDelete

urlpatterns = [
    url(r'^$', PostList.as_view(), name='post_list'),
    url(r'^post/(?P<pk>[0-9]+)/$', PostDetail.as_view(), name='post_detail'),
    url(r'^post/new/$', PostCreate.as_view(), name='post_new'),
    url(r'^post/(?P<pk>[0-9]+)/edit/$', PostUpdate.as_view(),
        name='post_edit'),
    url(r'^post/(?P<pk>\d+)/remove/$', PostDelete.as_view(),
        name='post_remove'),
    url(r'^drafts/$', views.post_draft_list, name='post_draft_list'),
    url(r'^post/(?P<pk>\d+)/publish/$',
        views.post_publish, name='post_publish'),
    url(r'^post/(?P<pk>\d+)/comment/$',
        views.add_comment_to_post, name='add_comment_to_post'),
    url(r'^comment/(?P<pk>\d+)/approve/$',
        views.comment_approve, name='comment_approve'),
    url(r'^comment/(?P<pk>\d+)/remove/$',
        views.comment_remove, name='comment_remove'),
    url(r'^user/new/$', views.user_new, name='user_new'),
    url(r'^access_denied/$', views.access_denied, name='access_denied'),
]
Exemple #17
0
    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),  # Para interfaz admin
    url(r'^login/$',
        'django.contrib.auth.views.login',
        {'template_name': 'blog/post_login.html'},
        name="post_login"),
    url(r'^logout/$',
        'django.contrib.auth.views.logout',
        {'next_page': 'http://localhost:8000'},
        name="post_logout"),
    url(r'^post/create/$',
        login_required(PostCreate.as_view()),
        name="post_create"),
    url(r'^post/(?P<pk>\d+)/edit$',
        login_required(PostUpdate.as_view()),
        name="post_update"),
    url(r'^post/(?P<pk>\d+)/delete$',
        login_required(PostDelete.as_view()),
        name="post_delete"),
    url(r'^post/(?P<pk>\d+)$', PostDetail.as_view(), name="post_detail"),
    #    url(r'^post/(?P<pk>\d+)/addcomment$', AddCommentView.as_view(), name="post_comment"),
    url(r'^$', PostList.as_view(),
        name="post_list"),  #Para interfaz vista IMPORTANTE
)

# urlpatterns = patterns ('blog.views',
#	url(r'^$',"post_list", )              Estas 3 lineas es para si tienes varias vista en el mismo archivo para no repetir blog.views

#)
Exemple #18
0
"""newsite URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/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 re_path, path
from blog.views import BlogPage, PostDetail, MonthStats

urlpatterns = [
    re_path(r'^$', BlogPage.as_view(), name='blog'),
    re_path(
        r'^admin/',
        admin.site.urls,
        name='admin',
    ),
    path('post/<int:blogpost_id>', PostDetail.as_view(), name='post'),
    path('stats/<str:year>/<str:month>', MonthStats.as_view(), name='stats')
]
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from blog.views import PostList, PostDetail, PostUpdate, PostDelete, PostCreate

admin.autodiscover()

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

    # 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'^post/(?P<pk>\d+)/edit$', login_required(PostUpdate.as_view()), name='post_update'),
    url(r'^post/create$', login_required(PostCreate.as_view()), name='post_create'),
    url(r'^post/(?P<pk>\d+)/delete$', login_required(PostDelete.as_view()), name='post_delete'),
    url(r'^post/(?P<pk>\d+)$', PostDetail.as_view(), name="post_detail"),
    url(r'^$', PostList.as_view(), name="post_list"),
    (r'^tinymce/', include('tinymce.urls')),
)
Exemple #20
0
from django.urls import path

from blog.views import (Index, PostDetail)

app_name = "blog"
urlpatterns = [
    path('', Index.as_view(), name='index'),
    path('<str:slug>/', PostDetail.as_view(), name='post-detail')
]
Exemple #21
0
from blog.views import PostList, PostDetail
from django.conf.urls import url
from django.urls import path

urlpatterns = [
    path('', PostList.as_view(), name='post-list'),
    path('<slug>', PostDetail.as_view(), name='post-detail'),
]
Exemple #22
0
"""untitled 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
from django.contrib import admin
from blog.views import PostList, PostDetail, PostCreate

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', PostList.as_view(),name='home'),
    url(r'^(?P<pk>\d+)/$',PostDetail.as_view(), name= 'detail'),
    url(r'^create/$', PostCreate.as_view(), name= 'create'),
]
Exemple #23
0
from django.urls import path,include
from blog.views import PostDetail, PostList

urlpatterns = [
    path('events/', PostList.as_view(), name='post_list'),
    path('<slug:slug>/', PostDetail.as_view(), name='post_detail'),
]
Exemple #24
0
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
from blog.views import PostList, PostDetail, PostCreate, PostEdit, PostDelete
from django.contrib.auth.decorators import login_required

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

    # 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'post/create$',
        login_required(PostCreate.as_view()),
        name='post_create'),
    url(r'post/(?P<pk>\d+)/edit$',
        login_required(PostEdit.as_view()),
        name='post_edit'),
    url(r'post/(?P<pk>\d+)/delete$',
        login_required(PostDelete.as_view()),
        name='post_delete'),
    url(r'post/(?P<pk>\d+)/$', PostDetail.as_view(), name='post_detail'),
    url(r'^tinymce/', include('tinymce.urls')),
    url(r'^$', PostList.as_view(), name='post_list'),
)
Exemple #25
0
from django.urls import path
from django.views.generic import TemplateView
from blog.views import list_post, update_post, delete_post, create_post, HomePageView, \
    MyView, PostList, PostDetail, PostCreate, PostUpdate, PostDelete

urlpatterns = [
    path('', list_post, name='list'),
    path('create/', create_post, name='create'),
    path('update/<int:pk>', update_post, name='update'),
    path('delete/<int:pk>', delete_post, name='delete'),

    # class based views
    path('home/', TemplateView.as_view(template_name='blog/post_list.html'), name='nome'),
    path('home1/', HomePageView.as_view(), name='home1'),
    path('view/', MyView.as_view(), name='view_post'),
    path('list/', PostList.as_view(), name='list_post'),
    path('detail/<int:pk>/', PostDetail.as_view(), name='detail_post'),
    path('post_create/', PostCreate.as_view(), name='create_post'),
    path('post_update/<int:pk>', PostUpdate.as_view(), name='update_post'),
    path('post_delete/<int:pk>', PostDelete.as_view(), name='delete_post')
]

Exemple #26
0
from django.conf.urls import url
from . import views
from blog.views import PostList, PostDetail, PostCreate, PostUpdate, PostDelete

urlpatterns = [
    url(r'^$', PostList.as_view(), name='post_list'),
    url(r'^post/(?P<pk>[0-9]+)/$', PostDetail.as_view(), name='post_detail'),
    url(r'^post/new/$', PostCreate.as_view(), name='post_new'),
    url(r'^post/(?P<pk>[0-9]+)/edit/$', PostUpdate.as_view(),
        name='post_edit'),
    url(r'^post/(?P<pk>\d+)/remove/$',
        PostDelete.as_view(),
        name='post_remove'),
    url(r'^drafts/$', views.post_draft_list, name='post_draft_list'),
    url(r'^post/(?P<pk>\d+)/publish/$',
        views.post_publish,
        name='post_publish'),
    url(r'^post/(?P<pk>\d+)/comment/$',
        views.add_comment_to_post,
        name='add_comment_to_post'),
    url(r'^comment/(?P<pk>\d+)/approve/$',
        views.comment_approve,
        name='comment_approve'),
    url(r'^comment/(?P<pk>\d+)/remove/$',
        views.comment_remove,
        name='comment_remove'),
    url(r'^user/new/$', views.user_new, name='user_new'),
    url(r'^access_denied/$', views.access_denied, name='access_denied'),
]
Exemple #27
0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import

from django.conf.urls import url
from blog.decorator import pjax

from blog.views import PostDetail, PostList, PostCreate

__author__ = 'korvin101'

urlpatterns = [
    url(r'^$', pjax(PostList.as_view(), 'blog/post_list_pjax.html'),
        name='post_list'),
    url(r'^post/$', pjax(PostList.as_view(), 'blog/post_list_pjax.html'),
        name='post_list'),
    url(r'^post/(?P<slug>[\w-]+)/$',
        pjax(PostDetail.as_view(), 'blog/post_detail_pjax.html'),
        name='post_detail'),
    url(r'^create/post/$', PostCreate.as_view(), name='create_post'),
]
Exemple #28
0
         UpdateCategory.as_view(),
         name='update_category'),
    path('category/delete/(?P<pk>\d+)/$/',
         DeleteCategory.as_view(),
         name='delete_category'),
    path('categories/', ViewCategories.as_view(), name='view_categories'),
    #Tags
    path('view/tags', ViewTag.as_view(), name='view_tag'),
    path('tag/create/', CreateTag.as_view(), name='create_tag'),
    path('tag/update/(?P<pk>\d+)/$/', UpdateTag.as_view(), name='update_tag'),
    path('tag/delete/(?P<pk>\d+)/$/', DeleteTag.as_view(), name='delete_tag'),
    #Setting
    path('create/setting/', CreateSetting.as_view(), name='create_setting'),
    path('view/setting', ViewSetting.as_view(), name='view_setting'),
    path('edit/setting/(?P<pk>\d+)/$/',
         UpdateSetting.as_view(),
         name='update_setting'),
    path('setting/delete/(?P<pk>\d+)/$/',
         DeleteSetting.as_view(),
         name='delete_setting'),
    #HOME
    path('', Home.as_view(), name='home'),
    path('home/blog', HomeBlog.as_view(), name='home_blog'),
    path('post/detail', PostDetail.as_view(), name='post_detail'),
]
if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)