Esempio n. 1
0
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path
from .views import bulletin_registration, delete_post, index, about, like_dislike_post, new_category, new_post, new_tag, pub_api, single, contact, search, category, tag, update_post
from authentication.middlewares.auth import auth_middleware, login_excluded
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    path('', index, name='home'),
    path('about', about, name='about'),
    path('posts/<slug>', single, name='single'),
    path('contact', contact, name='contact'),
    path('categories/<category_name>', category, name='category'),
    path('tags/<tag_name>', tag, name='tag'),
    path('category/new', csrf_exempt(new_category), name='new_category'),
    path('tag/new', csrf_exempt(new_tag), name='new_tag'),
    path('search', search, name='search'),
    path('like_dislike', like_dislike_post, name='like_dislike_post'),
    path('new-post', auth_middleware(new_post), name='new_post'),
    path('posts/<slug>/update',
         auth_middleware(update_post),
         name='update_post'),
    path('posts/<slug>/delete',
         auth_middleware(delete_post),
         name='delete_post'),
    path('bulletins/subscribe',
         bulletin_registration,
         name='bulletin_registration'),
    path('api/posts', pub_api, name='public_api')
]
Esempio n. 2
0
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from authentication.middlewares.auth import auth_middleware
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.cache import never_cache
from django.conf.urls import url
from ckeditor_uploader import views

urlpatterns = [
    path('admin/', admin.site.urls),
    # path('ckeditor/', include('ckeditor_uploader.urls')),
    url(r"^ckeditor/upload/",
        csrf_exempt(auth_middleware(views.upload)),
        name="ckeditor_upload"),
    url(
        r"^ckeditor/browse/",
        csrf_exempt(never_cache(auth_middleware(views.browse))),
        name="ckeditor_browse",
    ),
    path('accounts/', include('authentication.urls')),
    path('', include('core.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. 3
0
from .feeds import LatestPostsFeed

urlpatterns = [
    path('', index, name='home'),
    path('about/privacy-policy', privacy_policy, name='privacy_policy'),
    path('about/terms-conditions', terms_conditions, name='terms_conditions'),
    path('about/refund-policy', refund_policy, name='refund_policy'),
    path('about', about, name='about'),
    path('posts/<int:post_id>/<slug>', single, name='single'),
    path('contact', contact, name='contact'),
    path('categories/<category_name>', category, name='category'),
    path('tags/<tag_name>', tag, name='tag'),
    path('series/<int:series_id>/<series_slug>', series, name='series'),
    path('category/new', csrf_exempt(new_category), name='new_category'),
    path('tag/new', csrf_exempt(new_tag), name='new_tag'),
    path('series/new', auth_middleware(new_series), name='new_series'),
    path('search', search, name='search'),
    path('like_dislike', like_dislike_post, name='like_dislike_post'),
    path('new-post', auth_middleware(new_post), name='new_post'),
    path('posts/<int:post_id>/<slug>/update',
         auth_middleware(update_post),
         name='update_post'),
    path('posts/<int:post_id>/<slug>/delete',
         auth_middleware(delete_post),
         name='delete_post'),
    path('bulletins/subscribe',
         bulletin_registration,
         name='bulletin_registration'),
    path('bulletins/unsubscribe',
         bulletin_unsubscribe,
         name='bulletin_unsubscribe'),