Beispiel #1
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'),
]
Beispiel #2
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'),
]
Beispiel #3
0
"""jomlak URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
from .views import FirstView, SalView
from django.views.decorators.csrf import csrf_exempt

from posts.views import MakePost, SubmitPost, PostListView, LikePostView, Bot

urlpatterns = [
    url(r'^search/', FirstView.as_view()),
    url(r'^sal/$', SalView.as_view()),
    url(r'^form/$', MakePost.as_view()),
    url(r'^post/', SubmitPost.as_view()),
    url(r'^postlist/$', PostListView.as_view()),
    url(r'^like/(?P<asha>\d+)/$', LikePostView.as_view()),
    url(r'^bot/$', csrf_exempt(Bot.as_view())),
]
Beispiel #4
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
Beispiel #5
0
    path('instancedetail/<id>/', instance_detail, name='instance-detail'),
    # 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)
Beispiel #6
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()
Beispiel #7
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"),
]
Beispiel #8
0
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.contrib import admin
from posts.views import PostListView


admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', PostListView.as_view(), name='index'),
    url(r'^about/', TemplateView.as_view(template_name="about.html")),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^news/', include('news.urls')),
    url(r'^posts/', include('posts.urls')),
    url(r'^profiles/', include('profiles.urls')),
    url(r'^comments/', include('django.contrib.comments.urls')),
    (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
    (r'^accounts/', include('allauth.urls')),
)
Beispiel #9
0
"""django_test URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.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.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from posts.views import PostListView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('users/', include('users.urls')),
    path('posts/', include('posts.urls')),
    path('', PostListView.as_view(), name='main-page')
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Beispiel #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
Beispiel #11
0
from django.contrib import admin
from django.urls import path
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
from posts.views import PostView, PostListView

urlpatterns = [
    path('admin/', admin.site.urls),
    # Path to obtain a new access and refresh token
    path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    # Submit your refresh token to this path to obtain a new access token
    path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
    # Return 'Mods' model objects
    path('posts/', PostView.as_view(), name='post_view'),
    path('posts/list/', PostListView.as_view(), name='post_list_view'),
]
Beispiel #12
0
"""Posts app urls configuration."""

# Django
from django.urls import path

# Views
from posts.views import PostListView, CreatePostView, PostDetailView, LikePostView

urlpatterns = [
    path('', PostListView.as_view(), name='feed'),
    path('posts/new/', CreatePostView.as_view(), name='create_post'),
    path('posts/<int:pk>/<str:title>/',
         PostDetailView.as_view(),
         name='post_detail'),
    path('posts/like/<int:pk>/', LikePostView.as_view(), name='like_post')
]
Beispiel #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'),
]
Beispiel #14
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'),
]
Beispiel #15
0
from django.conf.urls import patterns
from django.conf.urls import include
from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from posts.views import (CreatePostView, EditPostView, PostListView, PostMineView,
    PostView, attend_post_view)

urlpatterns = patterns('',

    url(r'^$',
        PostListView.as_view(),
        name='posts_list'),
    url(r'^create/$',
        login_required(CreatePostView.as_view()),
        name='posts_create'),
    url(r'^mine/$',
        login_required(PostMineView.as_view()),
        name='posts_mine'),
    url(r'^(?P<post>\d+)/$',
        PostView.as_view(),
        name='posts_post'),
    url(r'^(?P<post>\d+)/edit/$',
        EditPostView.as_view(),
        name='posts_edit'),
    url(r'^(?P<post>\d+)/attend/$',
        login_required(attend_post_view),
        name='posts_attend'),
)
Beispiel #16
0
    IndexView,
    PostListView,
    PostDetailView,
    PostCreateView,
    PostUpdateView,
    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()),
Beispiel #17
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"), 
)
Beispiel #18
0
from django.urls import path
from posts.views import HomeView, PostListView
from . import views

app_name = 'posts'

urlpatterns = [
    path('', HomeView.as_view(), name='home'),
    #path('<slug:slug>/', PostDetailView.as_view(), name = 'post_detail' ),
    path('<slug:slug>/', views.postDetail, name='post_detail'),
    path('list', PostListView.as_view(), name='post_list'),
    path('edit/<slug:slug>/', views.editPost, name='edit_post'),
    path('delete/<slug:slug>/', views.deletePost, name='delete_post'),
]
Beispiel #19
0
from django.conf.urls import url, include

from posts.views import PostListView, CommentListView


urlpatterns = [
    url(r"^posts/", PostListView.as_view()),
    url(r"^comments/", CommentListView.as_view())
]
Beispiel #20
0
    path('users/<int:pk>/', UserDetailView.as_view(), name='user_detail'),
    path('signup/', NewUserView.as_view(), name='signup'),
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),

    # Blogs
    path('blogs/', BlogListView.as_view(), name='blog_list'),
    path('blogs/<int:pk>/', BlogDetailView.as_view(), name='blog_detail'),
    path('new-blog/', NewBlogView.as_view(), name='new_blog'),

    # Categories
    path('categories/', CategoryListView.as_view(), name='category_list'),
    path('categories/<int:pk>/',
         CategoryDetailView.as_view(),
         name='category_detail'),
    path('new-category/', NewCategoryView.as_view(), name='new_category'),

    # Posts
    path('blogs/<slug:blog_slug>/', PostListView.as_view(), name='post_list'),
    path('blogs/<slug:blog_slug>/<int:pk>/',
         PostDetailView.as_view(),
         name='post_detail'),
    path('new-post/', NewPostView.as_view(), name='new_post'),

    # Home
    path('', PostListView.as_view(), name='home'),

    # API
    path('api/v1/', include(router.urls))
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Beispiel #21
0
    BookListView,
    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"),
Beispiel #22
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'),
]
Beispiel #23
0
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 django.conf import settings
from django.conf.urls.static import static
from posts.views import PostListView

urlpatterns = [
    path('admin/', admin.site.urls),
    path("", PostListView.as_view(), name="index"),
    path("", include("users.urls")),
    path("", include("posts.urls")),

]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Beispiel #24
0
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 path, include
from django.conf import settings
from django.conf.urls.static import static
from posts.views import PostListView

urlpatterns = [
    path('', PostListView.as_view()),
    path('users/', include(('users.urls', 'users'), namespace='users')),
    path('posts/', include(('posts.urls', 'posts'), namespace='posts')),
    path('admin/', admin.site.urls),
    path('summernote/', include('django_summernote.urls')),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Beispiel #25
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'),
]
Beispiel #26
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)
Beispiel #27
0
from django.conf import settings
from django.conf.urls.static import static

from posts.api.views import SearchPostAPIView
from posts.views import PostListView
from .views import home, SearchView
from hashtags.api.views import TagPostAPIView

from accounts.views import UserRegisterView
from hashtags.views import HashTagView

urlpatterns = [
    url(r'^', include('django.contrib.auth.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^$', PostListView.as_view(), name='home'),
    url(r'^search/$', SearchView.as_view(), name='search'),
    url(r'^tags/(?P<hashtag>.*)/$', HashTagView.as_view(), name="hashtag"),
    url(r'^post/', include('posts.urls', namespace='post')),
    url(r'^api/post/', include('posts.api.urls', namespace='post-api')),
    url(r'^api/search/', SearchPostAPIView.as_view(), name='search-api'),
    url(r'^api/tags/(?P<hashtag>.*)', TagPostAPIView.as_view(), name='tag-post-api'),

    url(r'^register/$', UserRegisterView.as_view(), name='register'),
    url(r'^', include('accounts.urls', namespace='profiles')),
    url(r'^api/', include('accounts.api.urls', namespace='profiles-api')),
]

if settings.DEBUG:
    urlpatterns+=(static(settings.STATIC_URL, document_root=settings.STATIC_ROOT))
Beispiel #28
0
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter

from posts.api import PostViewSet
from posts.views import PostCreationView, PostDetailView, PostListView

router = DefaultRouter()
router.register('api/1.0/posts', PostViewSet, base_name='api_post')

urlpatterns = [
    url(r'^new-post/$', PostCreationView.as_view(), name='post_creation'),
    url(r'^blogs/(?P<username>\w+)/$',
        PostListView.as_view(),
        name='post_list'),
    url(r'^blogs/(?P<username>\w+)/(?P<pk>\d+)$',
        PostDetailView.as_view(),
        name='post_detail'),
    url(r'', include(router.urls))
]
Beispiel #29
0
from django.conf.urls import url
from posts.views import PostListView, test_view

urlpatterns = [
    url(r'^$', PostListView.as_view(), name='posts'),
    url(r'^test/$', test_view, name='test'),
]
Beispiel #30
0
)
from marketing.views import email_list_signup

urlpatterns = [
    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:
Beispiel #31
0
from django.conf import settings
from django.contrib import admin
from haystack.forms import SearchForm
from haystack.query import SearchQuerySet
from haystack.views import SearchView, search_view_factory
from posts.views import PostListView
from posts.models import Post
admin.autodiscover()

# TODO: Get ordering by likes working
#sqs = SearchQuerySet().order_by('-num_likes')#.exclude(body__isnull=True).exclude(body__exact='')
urlpatterns = patterns('haystack.views',
    # Examples:
    # url(r'^$', 'overheard.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', PostListView.as_view(), name='home'),
    url(r'^search/$', search_view_factory(), name='haystack_search'),
)

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += patterns('',
        url(r'^__debug__/', include(debug_toolbar.urls)),
    )

if not settings.DEBUG:
    urlpatterns += patterns('',
        (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
    )
Beispiel #32
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")
]
Beispiel #33
0
from django.urls import path

from blogs.api import BlogsListApiView
from blogs.views import BlogListView
from posts.views import PostListView

urlpatterns = [
    path('', PostListView.as_view(), name='home'),
    path('blogs', BlogListView.as_view(), name='blog_list'),

    #API Routes
    path('api/1.0/blogs', BlogsListApiView.as_view(), name='API_blogs_view')
]
Beispiel #34
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)
Beispiel #35
0
from django.conf.urls import patterns, url
from django.views.generic.base import TemplateView
from posts.views import PostListView
from agogee import views

urlpatterns = patterns("",
	url(r'^$', views.index, name='index'),
	url(r'^spartanMain', TemplateView.as_view(template_name='agogee/spartanMain.html'), name='spartanMain'),
	url(r'^events', TemplateView.as_view(template_name='agogee/events.html'), name='events'),
	url(r'^community', PostListView.as_view(), name='community'),
	#url(r'^community', TemplateView.as_view(template_name='agogee/community.html'), name='community'),
	url(r'^register', views.register, name='register'),
	url(r'^login/$', views.user_login, name='login'),
	url(r'^logout/$', views.user_logout, name='logout'),
	url(r'^profile', views.profile, name='profile'),
	url(r'^thankyou/$', TemplateView.as_view(template_name='agogee/thankyou.html'), name='thankyou'),
	url(r'^about/$', TemplateView.as_view(template_name='agogee/about.html'), name='about'),
)
Beispiel #36
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)
Beispiel #37
0
    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 accounts import views as accounts_views
from posts import views as posts_views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import views as auth_views
from posts.views import PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, UserPostListView

urlpatterns = [
    path('register/', accounts_views.register, name="lol-signup"),
    path('profile/', accounts_views.profile, name="lol-profile"),
    path('blog/', PostListView.as_view(), name="lol-blog"),
    path('user/<str:username>', UserPostListView.as_view(), name="user-posts"),
    path('profile/<str:username>',
         UserPostListView.as_view(),
         name="user-posts"),
    path('post/<int:pk>/', PostDetailView.as_view(), name="post-detail"),
    path('post/<int:pk>/update/', PostUpdateView.as_view(),
         name="post-update"),
    path('post/<int:pk>/delete/', PostDeleteView.as_view(),
         name="post-delete"),
    path('post/new/', PostCreateView.as_view(), name="post-create"),
    path('login/',
         auth_views.LoginView.as_view(template_name="accounts/login.html"),
         name="lol-login"),
    path('logout/',
         auth_views.LogoutView.as_view(template_name="entry/index.html"),