Ejemplo n.º 1
0
from django.conf.urls import patterns, url

from blog.views import HomePage, EditPost, DeletePost, NewPost, SinglePost

urlpatterns = patterns('blog.views',
    url(r'^$', HomePage.as_view(), name='blog_HomePage'),
    url(r'^newpost/$', NewPost.as_view(), name='blog_NewPost'),
    url(r'^post/(?P<slug>[\w-]+)$', SinglePost.as_view(), name='blog_SinglePost'),
    url(r'^edit/(?P<id>[0-9]+)$', EditPost.as_view(), name='blog_EditPost'),
    url(r'^delete$', DeletePost.as_view(), name='blog_DeletePost'),
)
Ejemplo n.º 2
0
from rest.views import (PostList, PostDetail, CreatePost, UpdatePost,
                        DeletePost)

urlpatterns = [
    path('batmans-admin/', admin.site.urls),

    ## BLOG URLS
    path('', PostListView.as_view(), name='post-list'),
    path('post/<slug>/<pk>/', PostDetailView.as_view(), name='post-detail'),
    ## GENERIC URLS
    path('about_us/', AboutView.as_view(), name='about'),
    path('contact_us/', ContactUsView.as_view(), name='contactus'),
    ## AUTH URLS
    path('login/', auth_views.LoginView.as_view(), name='login'),
    path('logout/', auth_views.LogoutView.as_view(), name='logout'),
    ## DABOARD URL AND CRUD OPERATIONS
    path('dashboard/', DashView.as_view(), name='dashboard'),
    path('newpost/create', CreateNew_post.as_view()),
    path('update_post/<pk>/update', UpdatePost.as_view(), name='update_post'),
    path('delete_post/<pk>/delete', DeletePost.as_view(), name='delete_post'),
    #### REACT NATIVE ELECTRON API'S URLS MOBILE DEVELOPMENT #####
    path('post/', PostList.as_view(), name='post-list'),
    path('post/<slug>/<pk>/', PostDetail.as_view(), name='post-detail'),
    path('post/create', CreatePost.as_view(), name='create-post'),
    path('post/<pk>/update', UpdatePost.as_view(), name='update-post'),
    path('post/<pk>/delete', DeletePost.as_view(), name='delete-post'),
    ## OTHER BASE URLS FOR DEPENDENCIES
    path('ckeditor/', include('ckeditor_uploader.urls')),
    path('api-auth/', include('rest_framework.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Ejemplo n.º 3
0
from django.conf.urls import include, url
from . import views
from blog.views import CreatePost, EditPost, DeletePost

urlpatterns = [
    url(r"^$", "blog.views.post_list", name="post_list"),
    url(
        r"^(?P<cat>[-\w]+)/(?P<slug>[-\w]+)/",
        include(
            [
                url(r"^$", views.post_view, name="post_view"),
                url(r"^edit/$", EditPost.as_view(), name="post_edit"),
                url(r"^delete/$", DeletePost.as_view(), name="post_delete"),
            ]
        ),
    ),
    url(r"^new/$", CreatePost.as_view(), name="post_create"),
]
Ejemplo n.º 4
0
from django.conf.urls import url, include
from blog import views
from blog.views import EditPost, DeletePost, CreatePost

urlpatterns = [
    url(r'^(?P<cat>[-\w]+)/(?P<slug>[-\w]+)/', include([
        url(r'^$', views.blog, name='blog'),
        url(r'^edit/$', EditPost.as_view(), name='post_edit'),
        url(r'^delete/$', DeletePost.as_view(), name='post_delete'),
    ])),
    url(r'^new/?$', CreatePost.as_view(), name='post_create'),
    url(r'^(?P<cat>[-\w]+)?$', views.cat)
]