#     url(r'^', include(organizer_urls)),

#     # BLOG
#     url(r'^blog/', include(blog_urls)),
# ]

# USING CLASS-BASED VIEW
from django.contrib import admin
from django.urls import path
from django.conf.urls import include, url

from organizer import urls as organizer_urls
from blog import urls as blog_urls
from blog.views import PostList
from suorganizer.views import redirect_root

urlpatterns = [

    # BLOG
    # '''This url redirect to: http://127.0.0.1:8000/blog/'''
    url(r'^$', redirect_root),
    # '''This url returns: http://127.0.0.1:8000/blog/'''
    url(r'^$', PostList.as_view()),  # replace by url above (line 50)
    url(r'^blog/', include(blog_urls)),

    # ORGANIZER
    url(r'^', include(organizer_urls)),

    # ADMIN
    path('admin/', admin.site.urls),
]
Exemple #2
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 #3
0
from blog.views import PostDetail, List, TagList, NoteDetail, PostList, NoteList
from django.urls import path

urlpatterns = [
    path('', List.as_view(), name='home'),
    path('blog/', PostList.as_view(), name='post_list'),
    path('blog/<slug:slug>/', PostDetail.as_view(), name='post_detail'),
    path('tag/<slug:slug>/', TagList.as_view(), name='tagged'),
    path('note/', NoteList.as_view(), name='note_list'),
    path('note/<slug:slug>/', NoteDetail.as_view(), name='note_detail'),
]
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 #5
0
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"),
    url(r'^post/', PostList.as_view(), name="post_list"),
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
    url(r'^tinymce/', include('tinymce.urls')),
)
Exemple #6
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'),
)
Exemple #7
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 #8
0
from django.contrib import admin
from django.urls import path, include
from blog.views import PostList
from . import views

urlpatterns = [
 		path('',PostList.as_view()),
 		path('<int:id>',views.postDetail , name = 'postDetail')
]
     
Exemple #9
0
# -*- encoding: utf-8 -*-
from blog.views import PostList, PostDetails
from django.conf.urls import patterns, include, url

urlpatterns = patterns(
    "",
    url(r"^$", PostList.as_view(), name="postlist"),
    url(r"^(?P<slug>[a-zA-Z0-9_-]+)/$", PostDetails.as_view(), name="postdetails"),
    #  url(r'^$','blog.views.NewPostList',name='index' ),
)
Exemple #10
0
from django.conf.urls import url

from blog.views import PostList, post_detail


urlpatterns = [
    url(r'^$', 
        PostList.as_view(),
        name='blog_post_list'),
    
    url(r'^(?P<year>\d{4})/'
        r'(?P<month>\d{1,2})/'
        r'(?P<slug>[\w\-]+)/$', 
        post_detail, 
        name='blog_post_detail'),
]   
Exemple #11
0
from django.urls import path
from blog.views import TagCreate, TagUpdate, TagDelete, TagDetail, TagList
from blog.views import PostCreate, PostUpdate, PostDelete, PostDetail, PostList

urlpatterns = [
    path('', PostList.as_view(), name='post_list_url'),
    path('post/create/', PostCreate.as_view(), name='post_create_url'),
    path('post/<str:slug>/', PostDetail.as_view(), name='post_detail_url'),
    path('post/<str:slug>/update',
         PostUpdate.as_view(),
         name='post_update_url'),
    path('post/<str:slug>/delete',
         PostDelete.as_view(),
         name='post_delete_url'),
    path('tags/', TagList.as_view(), name='tags_list_url'),
    path('tag/create/', TagCreate.as_view(), name='tag_create_url'),
    path('tag/<str:slug>/', TagDetail.as_view(), name='tag_detail_url'),
    path('tag/<str:slug>/update', TagUpdate.as_view(), name='tag_update_url'),
    path('tag/<str:slug>/delete', TagDelete.as_view(), name='tag_delete_url'),
]
Exemple #12
0
from django.conf.urls import url

from blog.views import PostList, PostDetail

urlpatterns = [
    url(
        r'^$',
        PostList.as_view(),
        name = 'main'
    ),
    url(
        r'^(?P<pk>\d+)/$',
        PostDetail.as_view(),
        name = 'posts',
    ),
]
Exemple #13
0
# Uncomment the next two lines to enable the admin:
from django.contrib import admin  # Para interfaz admin

admin.autodiscover()  # Para interfaz admin
from blog.views import PostList, PostDetail, PostCreate, PostUpdate, PostDelete  # , AddCommentView
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)),  # 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 #14
0
#!/usr/bin/env python
# encoding: utf-8

from django.conf.urls import url
from blog.views import (
        PostList,
        PostCreate,
        PostUpdate,
        PostDelete,

        CategoryList,
        CategoryCreate,
        CategoryUpdate,
        CategoryDelete,
        )

urlpatterns = [
    url(r'^post/create/$', PostCreate.as_view(), name="create posts"),
    url(r'^post/list/$', PostList.as_view(), name="posts list"),
    url(r'^post/update/(?P<pk>[0-9]+)/$', PostUpdate.as_view(), name="update posts"),
    url(r'^post/delete/(?P<pk>[0-9]+)/$', PostDelete.as_view(), name="delete posts"),

    url(r'^category/create/$', CategoryCreate.as_view(), name="create categorys"),
    url(r'^category/list/$', CategoryList.as_view(), name="categorys list"),
    url(r'^category/update/(?P<pk>[0-9]+)/$', CategoryUpdate.as_view(), name="update categorys"),
    url(r'^category/delete/(?P<pk>[0-9]+)/$', CategoryDelete.as_view(), name="delete categorys"),
]

Exemple #15
0
 def setUp(self):
     self.factory = APIRequestFactory()
     self.view = PostList.as_view()
     self.url = reverse("blog-posts")
Exemple #16
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")
)
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 #18
0
from django.urls import path
from blog.views import PostList, PostDetails, BlogUserList, BlogUserLike

urlpatterns = [
    path('posts/', PostList.as_view()),
    path('posts/<int:pk>', PostDetails.as_view()),
    path('bloggers/', BlogUserList.as_view()),
    path('bloggers/<int:pk>', BlogUserLike.as_view())
]
Exemple #19
0
from django.urls import path
from blog.views import all_posts, single_post, new_post, PostList
#have to import functions to declare

app_name = 'blog'

urlpatterns = [
    path('', all_posts, name='blog_list'),
    path('<int:id>', single_post, name='blog_detail'),
    path('new', new_post, name='new_post'),  #new is a name of html page

    #CBV
    path('cbv', PostList.as_view(), name='all_post_cbv'),
]
Exemple #20
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 #21
0
from django.conf.urls import patterns, url

from blog.views import PostList

urlpatterns = patterns('',
    url('^$', PostList.as_view())
)
Exemple #22
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 #23
0
from django.contrib import admin
from django.urls import path, include
from .views import ContactView, datasets, projects
from blog.views import PostList

urlpatterns = [
    path('', ContactView.as_view(), name='home'),
    path('blog/', PostList.as_view(), name='blog'),
    path('datasets/', datasets, name='datasets'),
    path('projects/', projects, name='projects')
]
Exemple #24
0
from django.conf.urls import url, include
from django.contrib import admin
from . import views
from blog.views import PostList

urlpatterns = [
    url(r'^$', PostList.as_view(), name='post_list'),
    # url(r'^$', views.post_list, name='post_list'),
    url(r'(?P<post>[-\w]+)/$', views.post_detail, name='post_detail'),
]
Exemple #25
0
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'))
"""
import blog
from blog.views import PostList
from django.contrib import admin
from django.urls import path
from django.urls import include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.sitemaps.views import sitemap
from blog.sitemaps import PostSiteMap

sitemaps = {'Post': PostSiteMap}

urlpatterns = [
    path('admin/', admin.site.urls),
    path('sitemap.xml',
         sitemap, {'sitemaps': sitemaps},
         name='django.contrib.sitemaps.views.sitemap'),
    path('markdownx/', include('markdownx.urls')),
    path('blog/', include('blog.urls'), name='blog'),
    path('api-auth/', include('rest_framework.urls')),
    path('api/', include('misc.api.urls')),
    path('', PostList.as_view(), name='root_post_list'),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Exemple #26
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 #27
0
"""simple_blog URL Configuration

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

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', PostList.as_view(), name='home'),
    path('blog/', include('blog.urls')),
    path('accounts/', include('accounts.urls', namespace='accounts')),
    path('accounts/', include('django.contrib.auth.urls')),
    path('thanks/', views.ThanksPage.as_view(), name='thanks'),
]
Exemple #28
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 #29
0
from django.urls import path
from . import views
from .feeds import LatestPostsFeed
from blog.views import PostList, PostCategoriesList

app_name = 'blog'
urlpatterns = [
    # post views
    path('', views.post_list, name='post_list'),
    # path('', views.PostListView.as_view(), name='post_list'),
    path('<int:year>/<int:month>/<int:day>/<slug:post>/',
         views.post_detail,
         name='post_detail'),
    path('<int:post_id>/share/', views.post_share, name='post_share'),
    path('tag/<slug:tag_slug>/', views.post_list, name='post_list_by_tag'),
    path('feed/', LatestPostsFeed(), name='post_feed'),
    path('search/', views.post_search, name='post_search'),
    path('restapi/', PostList.as_view(), name='post-list'),
    path('restapi/<pk>/', views.PostDetail.as_view(), name='post-detail'),
    path('categories/', PostCategoriesList.as_view(), name='post-cat'),
    path('categories/<pk>/',
         views.PostCategoriesDet.as_view(),
         name='post-cat-det'),
]
Exemple #30
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 #31
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 #32
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 #33
0
from django.conf.urls import url

from blog.views import PostList, PostDetailView
from . import views

urlpatterns = [
    # url(r'/add', views.add, name='add'),
    # url(r'/edit', views.edit, name='edit'),
    # url(r'/delete', views.delete, name='delete'),
    url(r'post/(?P<pk>\d+)/', PostDetailView.as_view(), name='post_id'),
    url(r'', PostList.as_view(), name='all'),
]