Exemple #1
0
    path("register/", users_views.register, name="register"),
    path('login/',
         auth_views.LoginView.as_view(template_name='users/login.html'),
         name='login'),
    path('logout/',
         auth_views.LogoutView.as_view(template_name='users/logout.html'),
         name='logout'),
    path("", index),
    path("", IndexView.as_view(), name="home"),
    path("blog/", post_list, name="post-list"),
    path("blog/", PostListView.as_view(), name="post-list"),
    path("search/", search, name="search"),
    path("email-signup/", email_list_signup, name="email-list-signup"),
    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")),
    path("accounts/", include("allauth.urls")),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Exemple #2
0
from django.urls import path

from posts.views import (PostCreateView, PostDeleteView, PostDetailView,
                         PostListView)

app_name = 'posts'

urlpatterns = [
    path('', PostListView.as_view(), name='list_post'),
    path('postar/', PostCreateView.as_view(), name='create_post'),
    path('post/<int:pk>/', PostDetailView.as_view(), name='detail_post'),
    path('deletar/<int:pk>/', PostDeleteView.as_view(), name='delete_post'),
]
Exemple #3
0
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from posts.api import PostViewSet
from posts.views import HomeView, PostDetailView, NewPostView
from users.views import UsersView, UserPostView, LoginView, LogoutView, SignupView
from users.api import UserViewSet, UserPostViewSet

router = DefaultRouter()
router.register('posts', PostViewSet, base_name='posts')
router.register('users', UserViewSet, base_name='users')
router.register('blogs', UserPostViewSet, base_name='blogs')


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name="home"),
    path('blogs/<username>/<int:pk>', PostDetailView.as_view(), name="post-detail"),
    path('blogs/', UsersView.as_view(), name="user-list"),
    path('blogs/<username>', UserPostView.as_view(), name="user-post-list"),
    path('new-post', NewPostView.as_view(), name='new-post'),
    path('login', LoginView.as_view(), name='login'),
    path('logout', LogoutView.as_view(), name='logout'),
    path('signup', SignupView.as_view(), name='signup'),

    # API URLs
    path('api/v1/', include(router.urls)),
    #path('api/v1/blogs/', UserPostViewSet.as_view({'list'}), name='blog-list'),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemple #4
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 posts.views import (
    PostListView,
    PostDetailView,
    PostCreateView,
    PostUpdateView,
    PostDeleteView,
    like,
)
from newsapp.views import index

urlpatterns = [
    path("admin/", admin.site.urls),
    path("accounts/", include("allauth.urls")),
    path("news/", index, name="newsapp"),
    path("", PostListView.as_view(), name="list"),
    path("create/", PostCreateView.as_view(), name="create"),
    path("<slug>/", PostDetailView.as_view(), name="detail"),
    path("<slug>/update/", PostUpdateView.as_view(), name="update"),
    path("<slug>/delete/", PostDeleteView.as_view(), name="delete"),
    path("like/<slug>/", like, name="like"),
]
Exemple #5
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 posts.views import index, post_list, search, PostDetailView, Posts_in_CategoryView, About, post_detail

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
    path('blog/', post_list),
    path('about/', About.as_view(), name='about'),
    path('search/', search, name='search'),
    # path('post/',post),
    path('post/<slug:slug>/', PostDetailView.as_view(), name='post-detail'),
    # path('post/<slug:slug>/',post_detail, name='post-detail'),
    path("category/<slug:slug>/posts",
         Posts_in_CategoryView,
         name="posts_in_category"),
    path('ckeditor/', include('ckeditor_uploader.urls')),
    #3rd party
    path('hitcount/',
         include(('hitcount.urls', 'hitcount'), namespace='hitcount')),
]
if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Exemple #6
0
from django.urls import path

from posts.api import PostListAPIView, PostDetailAPIView
from posts.views import HomeView, PostDetailView, NewPostView

urlpatterns = [
    path('blogs/<str:username>/<int:pk>', PostDetailView.as_view(), name="post_detail"),
    path('new-post', NewPostView.as_view(), name="new-post"),
    path('', HomeView.as_view(), name="home"),

    # API
    path('api/1.0/posts/', PostListAPIView.as_view(), name='post_list_api'),
    path('api/1.0/posts/<int:pk>', PostDetailAPIView.as_view(), name='post_detail_api')

]
Exemple #7
0
"""django_rest_network URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/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.urls import path

from posts.views import ListCreatePostView, PostDetailView

urlpatterns = [
    path('', ListCreatePostView.as_view(), name="post-list-create"),
    path('<int:pk>/', PostDetailView.as_view(), name="post-detail"),
    path('<int:pk>/<slug:slug>', PostDetailView.as_view(), name="post-detail"),
]
Exemple #8
0
from django.urls import path

from posts.views import PostListView, PostDetailView, TagListView, TagDetailView, TagCreate, PostCreate, TagUpdate, \
    TagDelete, post_delete, PostUpdate, search

urlpatterns = [
    path('tags/', TagListView.as_view(), name='tags_list'),
    path('tags/create/', TagCreate.as_view(), name='tag_create'),
    path('tags/<slug:url>/', TagDetailView.as_view(), name='tag_detail'),
    path('tags/<slug:url>/update/', TagUpdate.as_view(), name='tag_update'),
    path('tags/<slug:url>/delete/', TagDelete.as_view(), name='tag_delete'),
    path('posts/', PostListView.as_view(), name='post_list'),
    path('posts/create/', PostCreate.as_view(), name='post_create'),
    path('posts/<slug:url>/delete/', post_delete, name='post_delete'),
    path('posts/<slug:url>/', PostDetailView.as_view(), name='post_detail'),
    path('posts/<slug:url>/update/', PostUpdate.as_view(), name='post_update'),
    path('search/', search, name='search'),
]
Exemple #9
0
from django.conf.urls import url

from posts.views import PostListView, PostDetailView


urlpatterns = [
    url(r'^$', PostListView.as_view(), name='list'),
    url(r'^(?P<pk>[\d]+)/$', PostDetailView.as_view(), name='detail'),
    url(r'^(?P<slug>[-\w]+)/$',
        PostDetailView.as_view(), name='detail-by-slug'),
]
Exemple #10
0
from django.conf.urls import patterns, url

from posts.views import PostDetailView, PostListView


urlpatterns = patterns('',
    url(r'^$', PostListView.as_view(), name="list_posts"),
    url(r'^post/create/$', 'posts.views.create_post', name="create_post"),
    url(r'^post/(?P<pk>\d+)/$', PostDetailView.as_view(), name="post_detail"),
    url(r'^post/vote/(?P<post_id>\d+)/(?P<vote_type>\w+)/$', 'posts.views.vote', 
        name="vote"), 
)
Exemple #11
0
    BookUpdateView,
    PostCreateView,
    PostDeleteView,
    PostDetailView,
    PostListView,
    PostUpdateView,
    NewPostAndBookView,
)

app_name = "posts"
# NOTE: URL permisisons are being set in this file where applicable. /
# NOTE: Note the "login_required" functions in each appropriate each path().

urlpatterns = [
    path("", PostListView.as_view(), name="home"),
    path("<str:username>/<str:slug>/", PostDetailView.as_view(),
         name="review"),
    path("new_post/",
         login_required(NewPostAndBookView.as_view()),
         name="new_post"),
    # NOTE: I should be able to leave the update_post page as a PostUpdateView because
    # I won't ever need to update which book it's about.
    path(
        "update_post/<str:username>/<str:slug>",
        login_required(PostUpdateView.as_view()),
        name="update_post",
    ),
    path("books/", BookListView.as_view(), name="books"),
    path("books/update/<int:pk>", BookUpdateView.as_view(),
         name="update_book"),
    path("delete/<str:slug>-<int:pk>",
Exemple #12
0
from posts.views import PostListView, UserProfileDetailView, \
    UserProfileEditView, PostCreateView, PostDetailView, PostEditView, \
    PostDeleteView, VoteFormView, PostListAllView


urlpatterns = patterns(
    '',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', PostListView.as_view(), name='home'),
    url(r'^zakopalisko/$', PostListAllView.as_view(), name='lounge'),
    url(r'^login/$', "django.contrib.auth.views.login",
        {"template_name": "registration/login.html"}, name="login"),
    url(r'^logout/$',
        "django.contrib.auth.views.logout_then_login", name="logout"),
    url(r'^accounts/', include('registration.backends.simple.urls')),
    url(r'^users/(?P<slug>\w+)/$',
        UserProfileDetailView.as_view(), name='profile'),
    url(r'^edit_profile/$',
        login_required(UserProfileEditView.as_view()), name='edit_profile'),
    url(r'^post/create/$',
        login_required(PostCreateView.as_view()), name='create_post'),
    url(r'^post/(?P<pk>\d+)$',
        PostDetailView.as_view(), name='post_detail'),
    url(r'^post/edit/(?P<pk>\d+)$',
        login_required(PostEditView.as_view()), name='post_edit'),
    url(r'^post/delete/(?P<pk>\d+)$',
        login_required(PostDeleteView.as_view()), name='post_delete'),
    url(r'^vote/$', login_required(VoteFormView.as_view()), name="vote"),
)
Exemple #13
0
    PostListView,
    PostDetailView,
    PostCreateView,
    PostUpdateView,
    PostDeleteView,
    Previa_,
    Juveniles
       
    )



urlpatterns = [
    path('admin/', admin.site.urls),
    path('', PostListView.as_view(), name='list'),
    path('', PostDetailView.as_view(), name='cont'),
    path('<slug>/', PostDetailView.as_view(),name='detail'),
    path('<slug>/update/', PostUpdateView.as_view(), name='update'),
    path('<slug>/delete/', PostDeleteView.as_view(), name='delete'),
    path('create/', PostCreateView.as_view(), name='create'),
    path('posts/previa/', Previa_, name='previa'),
    path('posts/juveniles/', Juveniles, name='juveniles'),
    path('', General_, name='general'),
    path('posts/otros_dep/', Otros_Dep, name='otros_dep'),
    path('posts/futbol/', Futbol, name='futbol'),
    path(r'', admin.site.urls)



    
]
Exemple #14
0
         auth_views.PasswordResetView.as_view(
             template_name='users/password_reset.html'
         ),
         name='password_reset'),
    path('password-reset/done/',
         auth_views.PasswordResetDoneView.as_view(
             template_name='users/password_reset_done.html'
         ),
         name='password_reset_done'),
    path('password-reset-confirm/<uidb64>/<token>/',
         auth_views.PasswordResetConfirmView.as_view(
             template_name='users/password_reset_confirm.html'
         ),
         name='password_reset_confirm'),
    path('password-reset-complete/',
         auth_views.PasswordResetCompleteView.as_view(
             template_name='users/password_reset_complete.html'
         ),
         name='password_reset_complete'),
    path('crush/', home_view, name='crush'),
    path('crush/create/', CreateCrush, name="create-crush"),
    path('crush/<int:pk>/', PostDetailView.as_view(), name="post-detail"),
    path('crush/<int:pk>/update/', PostUpdateView.as_view(), name='post-update'),
    # path('post/<int:pk>/delete/', PostDeleteView.as_view(), name='post-delete'),
    path('tag/<slug:slug>/', tagged, name="tagged"),
]


if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemple #15
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 posts.views import (PostListview, PostDetailView, PostUpdateView,
                         PostCreateView, PostDeleteView, like)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/', include('allauth.urls')),
    path('', PostListview.as_view(), name="list"),
    path('create/', PostCreateView.as_view(), name="create"),
    path('<slug>/', PostDetailView.as_view(), name="detail"),
    path('<slug>/update/', PostUpdateView.as_view(), name="update"),
    path('<slug>/delete/', PostDeleteView.as_view(), name="delete"),
    path('like/<slug>/', like, name="like")
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
Exemple #16
0
        name='create_edit_comment'),

    # Vote views
    url(r'^api/v1/vote/$', VoteView.as_view(), name='vote'),

    # Follow views
    url(r'^api/v1/follow/$', FollowPostView.as_view(), name='follow_post'),

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

    # Question views
    url(r'^api/v1/profile/(?P<username>.+)/$', ProfileView.as_view()),
    url(r'^api/v1/topic/question/$', TopicQuestionView.as_view()),
    url(r'^api/v1/topic/(?P<topic_id>.+)/$', TopicDetailView.as_view()),
    url(r'^api/v1/topics/$', TopicView.as_view()),
    url(r'^api/v1/topic/$', TopicDetailView.as_view()),
    url(r'^api/v1/question/topic/$', QuestionTopicView.as_view()),
    url(r'^api/v1/questions/newest/$', QuestionView.as_view()),
    url(r'^api/v1/questions/$', QuestionView.as_view()),
    url(r'^api/v1/question/$', QuestionDetailView.as_view()),
    url(r'^api/v1/answers/$', AnswerView.as_view()),
    url(r'^api/v1/answer/$', AnswerDetailView.as_view()),

    # Notification views
    url(r'^api/v1/notifications/$', ReadView.as_view()),

    url(r'^api/v1/post/(?P<id>.+)/$', PostDetailView.as_view()),
    url('^.*$', IndexView.as_view())
]
Exemple #17
0
urlpatterns = [
    path('admin/', admin.site.urls),
    # path('', index),
    path('', IndexView.as_view(), name='home'),
    # path('accounts/profile/', IndexView.as_view()),
    # path('blog/', post_list, name='post-list'),
    path('blog/', PostListView.as_view(), name='post-list'),
    path('search/', search, name='search'),
    path('email-signup/', email_list_signup, name='email-list-signup'),
    # path('create/', post_create, name='post-create'),
    path('create/',
         permission_required('post_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/',
         permission_required('post_update')(PostUpdateView.as_view()),
         name='post-update'),
    # path('post/<id>/delete/', post_delete, name='post-delete'),
    path('post/<pk>/delete/',
         permission_required('post-delete')(PostDeleteView.as_view()),
         name='post-delete'),
    path('tinymce/', include('tinymce.urls')),
    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('accounts/', include('allauth.urls')),

    #self try categories
    path('category/<slug:cat>', cat_detail, name='cat-detail'),
Exemple #18
0
from django.urls import path
from django.views.decorators.vary import vary_on_cookie

from posts.views import PostDetailView, PostListView

urlpatterns = [
    path('', vary_on_cookie(PostListView.as_view()), name='index'),
    path('<int:year>/<int:month>/<int:day>/<slug:slug>/', vary_on_cookie(PostDetailView.as_view()), name='read'),
    path('tag/<slug:tag>', vary_on_cookie(PostListView.as_view()), name='tag_filter'),
]
Exemple #19
0
"""wordplease 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  url
from django.contrib.auth.decorators import login_required
from posts.views import HomeView, PostListViewByUser, PostDetailView, BlogListView, VanillaCreateView


urlpatterns = [

    url(r'^$', HomeView.as_view(), name="posts_home"),
    url(r'posts/new$', login_required(VanillaCreateView.as_view()), name="create_post"),
    url(r'blogs/$', BlogListView.as_view(), name="blogs_list"),
    url(r'posts/([0-9a-zA-Z]+)$', PostListViewByUser.as_view(), name='list_post'),
    url(r'^posts/(?P<loginname>[0-9a-zA-Z]+)/(?P<post_id>[0-9]+)$',PostDetailView.as_view(), name='posts_detail')

]
from django.urls import path
from posts.views import PostListView, PostDeleteView, PostDetailView, PostUpdateView
app_name = 'posts'

urlpatterns = [
    path('', PostListView.as_view(), name='posts-list'),
    path('<int:id>/detail/', PostDetailView.as_view(), name='posts-detail'),
    path('<int:id>/update/', PostUpdateView.as_view(), name='posts-update'),
    path('<int:id>/delete/', PostDeleteView.as_view(), name='posts-delete')
]
Exemple #21
0
from django.conf.urls import url

from posts.views import (PostCreateView, PostDeleteView, PostDetailView,
                         PostListView, PostUpdateView)

app_name = 'posts'

urlpatterns = [
    url(r'^$', PostListView.as_view(), name='list'),
    url(r'^create/$', PostCreateView.as_view(), name='create'),
    url(r'^(?P<slug>[-\w\d]+)/$', PostDetailView.as_view(), name='detail'),
    url(r'^(?P<slug>[-\w\d]+)/edit/$', PostUpdateView.as_view(),
        name='update'),
    url(r'^(?P<slug>[-\w\d]+)/delete/$',
        PostDeleteView.as_view(),
        name='delete'),
]
Exemple #22
0
from django.urls import path

from posts.views import posts_of_following_profiles, PostDetailView, PostCreate

app_name = 'posts'

urlpatterns = [
    path('', posts_of_following_profiles, name='posts-follow-view'),
    path('create_post/', PostCreate.as_view(), name='post-create-view'),
    path('<str:post_slug>/', PostDetailView.as_view(),
         name='post-detail-view'),
]
Exemple #23
0
from django.urls import path

from posts.views import PostListView, PostDetailView

app_name = 'posts'

urlpatterns = [
    path('<int:pk>/', PostDetailView.as_view(), name='detail'),
    path('', PostListView.as_view(), name='list'),
]
Exemple #24
0
# -*- coding: utf-8 -*-
from django.conf.urls import url

from posts.views import HomeView, PostCreateView, PostDetailView

__author__ = 'joseenriquesanchezalfonso'

urlpatterns = [
    # Post URLs
    url(r'^$', HomeView.as_view(), name='wordplease_home'),
    url(r'^blogs/(?P<username>[-\w]+)/(?P<pk>[0-9]+)$', PostDetailView.as_view(), name='post_detail'),
    url(r'^new-post$', PostCreateView.as_view(), name='create_post')
]
Exemple #25
0
    url(r'^logout/$', logout, {'next_page': '/'}, name='logout'),

    # -------- USER_AUTHENTICATION APP URL'S --------- #
    url(r'^userlist/$', UserListView.as_view()),
    url(r'^userlist/(?P<slug>[\w-]+)/$', UserDetailView.as_view()),
    url(r'^new-user/$', signup, name='signup'),
    url(r'^delete_user/(?P<id>\d+)$', delete_user, name='get_delete'),

    # <---------------- AUTHOR URL -------------->
    url(r'^authors/(?P<username>[\w-]+)/$',
        AuthorDetailView.as_view(),
        name='author-detail'),

    # -------- POSTS APP URL'S --------- #
    url(r'^posts/create/$', PostCreateView.as_view(),
        name='post-create'),  # ADD SLUG CONSTRAINT TO NOT CREATE 'create' SLUG
    url(r'^posts/(?P<slug>[-\w]+)/$', PostListView.as_view()),
    url(r'^posts/java/(?P<slug>[-\w]+)/$', PostDetailView.as_view()),
    url(r'^posts/python/(?P<slug>[-\w]+)/$', PostDetailView.as_view()),
    url(r'^posts/queue-models/(?P<slug>[-\w]+)$', PostDetailView.as_view()),
    url(r'^posts/production-planning/(?P<slug>[-\w]+)/$',
        PostDetailView.as_view()),
    url(r'^posts/machine-learning/(?P<slug>[-\w]+)/$',
        PostDetailView.as_view()),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    # CHANGE IF YOU ARE LIVE
## WARNING "delete_user" is for development stage, it is CSRF vulnerable
Exemple #26
0
from django.conf import settings
from django.contrib import admin
from django.urls import path
from django.conf.urls.static import static
from posts.views import index, about, contact, browse, search, PostDetailView

urlpatterns = [
    path('', index, name='home'),
    path('post/<int:pk>/detail/', PostDetailView.as_view(),
         name='post-detail'),
    path('search/', search, name='search'),
    path('browse/', browse, name='browse'),
    path('contact/', contact, name='contact'),
    path('about/', about, name='about'),
    path('admin/', admin.site.urls),
]
if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Exemple #27
0
from django.contrib import admin
from django.urls import path, include
from posts.views import PostListView, PostDetailView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', PostListView.as_view(), name='posts'),
    path('detail/<pk>/', PostDetailView.as_view(), name='detail'),
    path('hitcount/',
         include(('hitcount.urls', 'hitcount'), namespace='hitcount')),
]
    ContactView
    )
from marketing.views import email_list_signup

urlpatterns = [
    path('admin/', admin.site.urls),
    # path('', index),
    path('', IndexView.as_view(), name='home'),
    # path('blog/', post_list, name='post-list'),
    path('blog/', PostListView.as_view(), name='post-list'),
    path('search/', SearchView.as_view(), name='search'),
    path('email-signup/', email_list_signup, name='email-list-signup'),
    # 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/<str:slug>-<int:pk>/', PostDetailView.as_view(), name='post-detail'),
    # path('post/<id>/update/', post_update, name='post-update'),
    path('post/<int:pk>/update/', PostUpdateView.as_view(), name='post-update'),
    # path('post/<id>/delete/', post_delete, name='post-delete'),
    path('post/<int:pk>/delete/', PostDeleteView.as_view(), name='post-delete'),
    path('contact/', ContactView, name='contact'),
    path('vote/', VoteView, name='vote_post'),
    path('searchbycat/<category>/', blog_category, name='searchbycat'),
    path('searchbytag/<tags>/', blog_tags, name='searchbytag'),
    
    path('tinymce/', include('tinymce.urls')),
    path('accounts/', include('allauth.urls')),
    path('accounts/profile/',
         TemplateView.as_view(template_name='account/profile.html'),
         name='profile')
"""myblog 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 posts.views import PostListView, PostDetailView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', PostListView.as_view(), name='posts'),
    path('<slug:slug>/', PostDetailView.as_view(), name='detail'),
    path('hitcount/', include(('hitcount.urls', 'hitcount'), namespace='hitcount')),
]
Exemple #30
0
from django.conf.urls import patterns, include, url
from django.contrib import admin

from posts.views import HomeView, PostDetailView

urlpatterns = patterns(
    '',
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^post/(?P<pk>\d+)/$', PostDetailView.as_view(), name='post_detail'),
    url(r'^admin/', include(admin.site.urls)),
)
Exemple #31
0
from posts.views import LatestPostsView, PostDetailView, NewPostView
from users.api import UsersViewSet, BlogsListAPIView
from users.views import BlogsListView, BlogView, LoginView, LogoutView, SignupView

# API
router = SimpleRouter()
router.register('api/posts', PostsViewSet, basename='posts_api')
router.register('api/users', UsersViewSet, basename='users_api')

urlpatterns = [
    path('admin/', admin.site.urls),
    # Users
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('signup/', SignupView.as_view(), name='signup'),
    # Blogs
    path('blogs/', BlogsListView.as_view(), name='blogs_list'),
    path('blogs/<str:username>/', BlogView.as_view(), name='user_blog'),
    path('blogs/<str:username>/<int:pk>',
         PostDetailView.as_view(),
         name='user_post'),
    # Posts
    path('', LatestPostsView.as_view(), name='home'),
    path('new/', NewPostView.as_view(), name='new_post'),
    # API
    path('api/blogs/', BlogsListAPIView.as_view(), name='blogs_api'),
    path('api/blogs/<str:username>',
         UserPostsAPIView.as_view(),
         name='user_posts')
] + router.urls
Exemple #32
0
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView

from django.contrib import admin
admin.autodiscover()

from posts.views import PostArchiveIndexView, PostArchiveMonthView, PostArchiveYearIndex, PostDetailView, PostListView, PostTagListView, sitemaps
from posts.feeds import PostFeed

urlpatterns = patterns('',
    url(r'^$', PostListView.as_view(), name='post_list'),
    url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
    url(r'^atom\.xml$', PostFeed(), name='feed'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^archive/$', PostArchiveIndexView.as_view(), name='archive_index'),
    url(r'^archive/(?P<year>[0-9]{4})/$', PostArchiveYearIndex.as_view(), name='archive_year'),
    url(r'^archive/(?P<year>[0-9]{4})/(?P<month>[0-9]{,2})/$', PostArchiveMonthView.as_view(), name='archive_month'),
    url(r'^tags/$', PostTagListView.as_view(), {'tag': None}, name='tag_list'),
    url(r'^tag/(?P<tag>[a-zA-Z\-0-9]+)$', PostTagListView.as_view(), name='tag_detail'),
    url(r'^(?P<slug>[a-zA-Z\-0-9]+)/$', PostDetailView.as_view(), name='post_detail'),
)

handler500 = TemplateView.as_view(template_name="500.html")
handler403 = TemplateView.as_view(template_name="403.html")

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns += staticfiles_urlpatterns()
Exemple #33
0
from django.urls import path
from posts.views import PostListView, PostCreateView, PostDetailView

app_name = "posts"

urlpatterns = [
    path('', PostListView.as_view(), name="list"),
    path('posts/new', PostCreateView.as_view(), name="create"),
    path('posts/<int:pk>', PostDetailView.as_view(), name="detail")
]
Exemple #34
0
from django.conf.urls import url

from posts.views import PostListView, PostDetailView

urlpatterns = [
    url(r'^$', PostListView.as_view(), name='list'),
    url(r'^(?P<pk>[\d]+)/$', PostDetailView.as_view(), name='detail'),
    url(r'^(?P<slug>[-\w]+)/$',
        PostDetailView.as_view(),
        name='detail-by-slug'),
]
Exemple #35
0
    path('products/buy/<int:id>/', buy_now, name='buy_now'),
    # Accounts Related
    path('register/', register_view, name='register'),
    path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'),
    path('logout/', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout'),
    # Password related
    path('password_reset/', auth_views.PasswordResetView.as_view(template_name='password/password_reset.html'),
         name='password_reset'),
    path('password_reset_confirm/<uidb64>/<token>/',
         auth_views.PasswordResetConfirmView.as_view(template_name='password/password_reset_confirm.html'),
         name='password_reset_confirm'),
    path('password_reset/done', auth_views.PasswordResetDoneView.as_view(template_name='password/password_reset_done.html'),
         name='password_reset_done'),
    path('password_reset/complete', auth_views.PasswordResetCompleteView.as_view(template_name="password/password_reset_complete.html"),
         name='password_reset_complete'),
    # Profile etc
    path('profile/', profile, name="profile"),
    path('preferences/', preference, name="preference"),
    # Posts related
    path('posts/', PostListView.as_view(), name='posts'),
    path('posts/<int:pk>/', PostDetailView.as_view(), name='post-detail'),
    path('posts/create/', PostCreateView.as_view(), name='post_create'),
    path('posts/<int:pk>/update', PostUpdateView.as_view(), name='post-update'),
    path('posts/<int:pk>/delete', PostDeleteView.as_view(), name='post-delete'),

]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Exemple #36
0
from django.urls import path
from posts.views import PostDetailView

urlpatterns = [
    path('<int:post_id>', PostDetailView.as_view(), name='posts-details')
]
Exemple #37
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 posts.views import (
    PostListView,
    PostDetailView,
    PostCreateView,
    PostUpdateView,
    PostDeleteView,
    like,
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/', include('allauth.urls')),
    path('', PostListView.as_view(), name='list'),
    path('create/', PostCreateView.as_view(), name='create'),
    path('posts/<slug>/', PostDetailView.as_view(), name='detail'),
    path('posts/<slug>/update/', PostUpdateView.as_view(), name='update'),
    path('posts/<slug>/delete/', PostDeleteView.as_view(), name='delete'),
    path('like/<slug>/', like, name='like'),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
Exemple #38
0
from django.conf.urls import url

from posts.views import PostListView, PostDetailView

urlpatterns = [
    url(r'^$', PostListView.as_view(), name='post-list'),
    url(r'(?P<pk>[\d+])$', PostDetailView.as_view(), name='post-detail'),
]