Esempio n. 1
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'),
]
Esempio n. 2
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)
    follow_index,
    profile_follow,
    profile_unfollow,
    PostCreateView,
    PostDetailView,
    PostUpdateView,
    ProfileView,
    CommentCreateView,
    PostListView,
)

urlpatterns = [
    path("group/<slug:slug>/", GroupPostsView.as_view(), name="group_posts"),
    path("follow/", follow_index, name="follow_index"),
    path("<str:username>/follow/", profile_follow, name="profile_follow"),
    path("<str:username>/unfollow/", profile_unfollow,
         name="profile_unfollow"),
    path("new/", PostCreateView.as_view(), name="new_post"),
    path("<str:username>/<int:pk>/",
         PostDetailView.as_view(),
         name="post_view"),
    path("<str:username>/<int:pk>/edit/",
         PostUpdateView.as_view(),
         name="post_edit"),
    path("<str:username>/", ProfileView.as_view(), name="profile"),
    path("<username>/<int:post_id>/comment",
         CommentCreateView.as_view(),
         name="add_comment"),
    path('', PostListView.as_view(), name="index"),
]
Esempio n. 4
0
# This file means

from django.urls import path
from posts.views import PostListView, PostCreateView, PostUpdateView, PostDeleteView

app_name = 'posts'

urlpatterns = [
    path('showPosts', PostListView.as_view(), name='showPosts'),
    path('createposts', PostCreateView.as_view(), name='createPosts_posts'),
    path('posts/<int:pk>/alterar',
         PostUpdateView.as_view(),
         name='update_post'),
    path('posts/<int:pk>/deletar',
         PostDeleteView.as_view(),
         name='delete_post'),
]
Esempio n. 5
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")
]
Esempio n. 6
0
from django.urls import path
from posts.views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, CategoryListView, UserPostListView, about, service
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('', PostListView.as_view(), name='index'),
    path('posts/<slug:slug>/', PostDetailView.as_view(), name='post-detail'),
    path('user/<str:username>/', UserPostListView.as_view(),
         name='user-posts'),
    path('category/<str:category>/',
         CategoryListView.as_view(),
         name='category-posts'),
    path('post/new/', PostCreateView.as_view(), name='post-create'),
    path('posts/<slug:slug>/update',
         PostUpdateView.as_view(),
         name='post-update'),
    path('posts/<slug:slug>/delete',
         PostDeleteView.as_view(),
         name='post-delete'),
    path('about/', about, name='about'),
    path('service/', service, name='service')
]

# for adding media file settings
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Esempio n. 7
0
from django.urls import path
from posts.views import PostListView, PostCreateView, PostUpdateView, PostDeleteView, PostDetailView

app_name = 'posts'

urlpatterns = [
    path('post', PostListView.as_view(), name='pagina_post'),
    path('adicionar', PostCreateView.as_view(), name='criar_post'),
    path('posts/<int:pk>/editar', PostUpdateView.as_view(),
         name='update_post'),
    path('posts/<int:pk>/deletar',
         PostDeleteView.as_view(),
         name='delete_post'),
    path('posts/<int:pk>/detalhes',
         PostDetailView.as_view(),
         name='detail_post'),
]
Esempio n. 8
0
from django.urls import path
from posts.views import index, PostListView, PostDeleteView, PostUpdateView, PostDetailView, PostCreateView

app_name = 'posts'

urlpatterns = [
    path("", index, name="index"),
    path("allposts", PostListView.as_view(), name="allposts"),
    path("deletepost/<int:pk>/", PostDeleteView.as_view(), name="deletepost"),
    path("update/<int:pk>/", PostUpdateView.as_view(), name="update"),
    path("detail/<int:pk>/", PostDetailView.as_view(), name="detail"),
    path("create", PostCreateView.as_view(), name="create"),
]
Esempio n. 9
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"),
)
Esempio n. 10
0
    url(r'^admin/', admin.site.urls),
    url(r'^$', TemplateView.as_view(template_name='home.html')),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', logout, {'next_page': '/'}, name='logout'),
    #<---------------- USER_AUTHENTICATION APP'S 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'),
    # <---------------- POST LIST APP'S URL'S -------------->
    url(r'^posts/create/$', PostCreateView.as_view(), name='post-create'),
    url(r'^posts/$', PostListView.as_view(), name='post-list'),
    url(r'^posts/(?P<post_id>\w+)/$',
        PostDetailView.as_view(),
        name='post-detail'),
    # url(r'^posts/$', PostTemplateView.as_view()),
    # url(r'^postlists/(?P<slug>\w+)/$', PostListView.as_view()),
    # url(r'^postlists/(?P<post_id>\w+)/$', PostDetailView.as_view()),
    url(r'^home/', TemplateView.as_view(template_name='home.html')),
]
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
Esempio n. 11
0
# -*- coding: utf-8 -*-
from posts.views import PostCreateView, PostsUserViewAll
from posts.views import PostsUserView, PostsDetailView
from django.conf.urls import url


urlpatterns = [
    url(r'posts/$', PostsUserViewAll.as_view(), name='user_posts_single'),
    url(r'posts/(?P<username>[-\w]+)/$', PostsUserView.as_view(), name='user_posts'),
    url(r'posts/(?P<username>[-\w]+)/(?P<pk>[0-9]+)$', PostsDetailView.as_view(), name='post_detail'),
    url(r'^new-post$', PostCreateView.as_view(), name='post_create'),
]
Esempio n. 12
0
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from users.views import register, profile

from django.contrib.auth import views as auth_views
from posts.views import PostCreateView, PostUpdateView, PostDeleteView, search, news, index, about, post, like, dislike

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index, name='index'),
    path('blog/', news, name='blog'),
    path('about/', about, name='about'),
    path('search/', search, name='search'),
    path('create/',
         PostCreateView.as_view(template_name='create.html'),
         name='create'),
    path('article/<slug>/<post_id>/update/',
         PostUpdateView.as_view(template_name='create.html'),
         name='update-post'),
    path('article/<slug>/<post_id>/delete/',
         PostDeleteView.as_view(template_name='post_confirm_delete.html'),
         name='delete-post'),
    path('article/<slug>/<int:post_id>/', post, name='post'),
    path('article/<slug>/<int:post_id>/like/<int:comment_id>/',
         like,
         name='like'),
    path('article/<slug>/<int:post_id>/dislike/<int:comment_id>/',
         dislike,
         name='dislike'),
    path('register/', register, name='register'),
Esempio n. 13
0
from django.urls import path
from posts.views import PostListView, PostCreateView, PostUpdateView, PostDeleteView

app_name = 'posts'

urlpatterns = [
    path('posts', PostListView.as_view(), name='list_posts'),
    path('addposts', PostCreateView.as_view(), name='add_post'),
    path('posts/<int:pk>/alterar',
         PostUpdateView.as_view(),
         name='update_post'),
    path('posts/<int:pk>/deletar',
         PostDeleteView.as_view(),
         name='delete_post'),
]
Esempio n. 14
0
from django.urls import path
from posts.views import ListPostsView, PostCreateView, PostUpdateView, PostDeleteView, PostDetailView
app_name = 'posts'

urlpatterns = [
    path('posts', ListPostsView.as_view(), name='ListPosts'),
    path('criacao', PostCreateView.as_view(), name='CriaPosts'),
    path('posts/<int:pk>/alterar',
         PostUpdateView.as_view(),
         name='atualizaPosts'),
    path('posts/<int:pk>/deletar',
         PostDeleteView.as_view(),
         name='deletaPosts'),
    path('posts/<int:pk>/detalhar',
         PostDetailView.as_view(),
         name='detalhaPosts'),
]
Esempio n. 15
0
    url(r'^login/$', LoginView.as_view(), name='login'),
    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
Esempio n. 16
0
from django.urls import path
from posts.views import PostListView, PostCreateView, PostUpdateView, PostDeletView

#sabe quando vc vai na barra la em cima de pesquisa? www......
#Pronto. aqui criaremos a palavra que será usada depois de / para acessar o html desejado

#Lembra de quando usamos o comando URL no html pra linkar com algo (redirecionar)?
#Pronto. Aqui também é onde definimos o 'nome' desses urls para linkarmos no html base

app_name = 'posts'  # relacionando com o app de 'MY APPS' do settings.py

urlpatterns = [
    #comando padrão:
    #path('palavra da barra de pesquisa', comando_criado_por_vc_no_views.as_view(),name = 'urls do base.html'),
    path('posts', PostListView.as_view(), name='posts_posts'),
    # definimos o que temos que escrever na barra de pesquisa pra acessar posts (\posts)
    # e também definimos o nome ('name') que usaremos  no html base para acessar esse \posts (posts_posts)
    path('novopost', PostCreateView.as_view(), name='novo_post'),
    path('post/<int:pk>/edit', PostUpdateView.as_view(), name='edit_post'),
    path('post/<int:pk>/delet', PostDeletView.as_view(), name='delet_post'),
]
Esempio n. 17
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'),
]
Esempio n. 18
0
    PostCreateView,
    PostUpdateView,
    PostDeleteView)
# 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/', search, name='search'),
    # path('email-signup/', email_list_signup, name='email-list-signup'),
    # path('create/', post_create, name='post-create'),
    path('create/',
         staff_member_required(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/',
         staff_member_required(PostUpdateView.as_view()),
         name='post-update'),
    # path('post/<id>/delete/', post_delete, name='post-delete'),
    path('post/<pk>/delete/',
         staff_member_required(PostDeleteView.as_view()),
         name='post-delete'),
    path('tinymce/', include('tinymce.urls')),
    path('accounts/', include('allauth.urls'))
]
Esempio n. 19
0
from django.urls import path
from posts.views import PostListView, PostCreateView, PostDeleteView, PostUpdateView

app_name = 'posts'

urlpatterns = [
    path('posts',PostListView.as_view() ,name='posts_blog'),
    path('criarpost', PostCreateView.as_view(), name='criar_posts'),
    path('posts/<int:pk>/apagar', PostDeleteView.as_view(), name = 'apagar_post'),
    path('posts/<int:pk>/editar', PostUpdateView.as_view(), name= 'editar_post'),
]
Esempio n. 20
0
                        PostDetailView, PostVoteView
from comments.views import CommentCreateView, CommentVoteView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include("django.contrib.auth.urls")),
    url(r'^create/user$', UserCreateView.as_view(), name="user_create_view"),
    url(r'^$', IndexView.as_view(), name="index_view"),
    url(r'^subreddits/$',
        SubredditListView.as_view(),
        name="subreddit_list_view"),
    url(r'^subreddit/(?P<pk>\d+)/$',
        SubredditDetailView.as_view(),
        name="subreddit_detail_view"),
    url(r'^subreddit/(?P<pk>\d+)/post/create/$',
        PostCreateView.as_view(),
        name='post_create_view'),
    url(r'^post/(?P<pk>\d+)/$',
        PostDetailView.as_view(),
        name='post_detail_view'),
    url(r'^post/(?P<pk>\d+)/upvote/$',
        PostVoteView.as_view(),
        name='post_upvote_view'),
    url(r'^post/(?P<pk>\d+)/downvote/$',
        PostVoteView.as_view(),
        name='post_downvote_view'),
    url(r'^post/(?P<pk>\d+)/comment/$',
        CommentCreateView.as_view(),
        name='comment_create_view'),
    url(r'^comment/(?P<pk>\d+)/upvote/$',
        CommentVoteView.as_view(),
Esempio n. 21
0
    path("admin/", admin.site.urls),
    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)
Esempio n. 22
0
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.contrib.auth import views as auth_views
from posts.views import PostCreateView,index,category,deletePost, updatePost,random_post, post, like, dislike, like_comment, dislike_comment
from users.views import register, profile

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index, name='index'),
    path('random/', random_post, name='random'),
    path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'),
    path('signup/', register, name='signup'),
    path('upload/', PostCreateView.as_view(template_name='upload.html'), name='upload'),
    path('update/<str:post_id>/', updatePost, name='update'),
    path('logout/', auth_views.LogoutView.as_view(template_name='index.html'), name='logout'),
     path('u/<str:username>/', profile, name='profile'),
    path('gag/<str:post_id>/', post, name='post'),
    path('gag/<str:post_id>/like/', like, name='like'),
    path('gag/<str:post_id>/dislike/', dislike, name='dislike'),
    path('gag/<str:post_id>/like/<int:comment_id>/', like_comment, name='like_comment'),
    path('gag/<str:post_id>/dislike/<int:comment_id>/',
         dislike_comment, name='dislike_comment'),
    path('<str:categories>/', category, name='category'),
    path('delete/<str:post_id>',deletePost,name='delete')

]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
Esempio n. 23
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)
Esempio n. 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')
]
Esempio n. 25
0
    PostDeleteView,
    CatDetailView,
    cat_detail)

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')),
Esempio n. 26
0
    # path('accounts/',include('django.contrib.auth.urls')),
    # path('accounts/password_reset/',password_reset,name='password_reset'),
    # path('accounts/password_reset_done/',password_reset_done,name='password_reset_done'),
    path('profile/', profile, name='profile'),
    path('mypage/', mypage, name='mypage'),
    path('myuser/', myuser, name='myuser'),
    path('register/', register, name='register'),
    # path('post/<int:pk>/delete/', PostDeleteView.as_view(), name='post-delete'),
    path('search/', search, name='search'),
    path('subscribe/', email_list_signup, name='subscribe'),
    path('tinymce/', include('tinymce.urls')),
    # path('post/',product_create_view, name = 'product_create_view'),
    path('send/', send_email, name='send_email'),
    path('filter_dropdown2/', filter_dropdown2, name='filter_dropdown2'),
    path('', PostListView.as_view(), name='post_changelist'),
    path('post/', PostCreateView.as_view(), name='post_add'),
    path('<int:pk>/', PostUpdateView.as_view(), name='post_change'),
    path('ajax/load-cities/', load_cities, name='ajax_load_cities'),
    path('ajax/load-categories/', load_categories,
         name='ajax_load_categories'),
    path('membership/', MembershipSelectView.as_view(), name='select'),
    path('payment/', PaymentView, name='payment'),
    path('update-transactions/<subscription_id >/',
         updateTransactions,
         name='update-transactions'),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
Esempio n. 27
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)
Esempio n. 28
0
    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.contrib.auth import views
from django.urls import path, include
from users.views import signUp
from posts.views import PostCreateView

urlpatterns = [
    path('', include('posts.urls'), name='posts'),
    path('posts/', include('posts.urls'), name='posts'),
    path('posts/new/',
         PostCreateView.as_view(template_name='posts/post_form.html'),
         name='postCreate'),
    path('admin/', admin.site.urls),
    path('users/sign_up', signUp, name='signUp'),
    path('users/sign_in',
         views.LoginView.as_view(template_name='users/sign_in.html'),
         name='signIn'),
    path('users/sign_out',
         views.LogoutView.as_view(template_name='users/sign_out.html'),
         name='signOut'),
]