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

from blog.views import BlogList, BlogDetail

urlpatterns = patterns('blog',
    url(r'^$', BlogList.as_view(), name='blog'),
    url(r'^(?P<slug>[-\w]+)/$', BlogDetail.as_view(), name='blog_detail'),
)
Ejemplo n.º 2
0
from django.urls import path

from blog.views import BlogList, BlogDetail, BlogCreate, BlogUpdate, BlogDelete

urlpatterns = [
    path('', BlogList.as_view(), name='home'),
    path('post/<int:pk>/', BlogDetail.as_view(), name='post_detail'),
    path('post/new/', BlogCreate.as_view(), name='post_new'),
    path('post/<int:pk>/edit/', BlogUpdate.as_view(), name='post_edit'),
    path('post/<int:pk>/delete/', BlogDelete.as_view(), name='post_delete'),
]
Ejemplo n.º 3
0
from filebrowser.sites import site as filebrowser_site
from index.views import IndexView
from blog.views import (BlogList, BlogTopic, LightList, LightItem)
from photo.views import (
    PhotoList,
    PhotoGallery,
)
from django.conf import settings
from django import views

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^admin/grappelli/', include('grappelli.urls')),
    url(r'^admin/filebrowser/', include(filebrowser_site.urls)),
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^blog/$', BlogList.as_view(), name='blog_list'),
    url(r'^blog/(?P<page>[0-9]+)/$', BlogList.as_view(), name='blog_list'),
    url(r'^blog/topic/([0-9]+)/$', BlogTopic.as_view(), name='blog_topic'),
    url(r'^photo/$', PhotoList.as_view(), name='photo_list'),
    url(r'^photo/gallery/([0-9]+)/$',
        PhotoGallery.as_view(),
        name='photo_gallery'),
    url(r'^events/$', LightList.as_view(), {
        "name": 'event_list',
        "topic_type": 1,
        "detail_item_uri": "/event/date/"
    }),
    url(r'^event/date/(?P<id>[0-9]+)/', LightItem.as_view(), {
        "name": 'event_item',
        "topic_type": 1
    }),
Ejemplo n.º 4
0
from django.conf.urls import url
from blog.views import BlogDetail, BlogPostDetail, BlogList, BlogUpdate, BlogCreate, BlogPostCreate, BlogPostUpdate, \
    BlogPostImageCreate

urlpatterns = [
    url(r'^$', BlogList.as_view(), name='blog-list'),
    url(r'^add/$', BlogCreate.as_view(), name='blog-create'),
    url(r'^(?P<blog_slug>[\w-]+)/post-create/$',
        BlogPostCreate.as_view(),
        name='blog-post-create'),
    url(r'^(?P<blog_slug>[\w-]+)/update/$',
        BlogUpdate.as_view(),
        name='blog-update'),
    url(r'^(?P<blog_slug>[\w-]+)/p(?P<post_pk>[0-9]+)/$',
        BlogPostDetail.as_view(),
        name='blog-post-detail'),
    url(r'^(?P<blog_slug>[\w-]+)/p(?P<post_pk>[0-9]+)/update/$',
        BlogPostUpdate.as_view(),
        name='blog-post-update'),
    url(r'^(?P<blog_slug>[\w-]+)/$', BlogDetail.as_view(), name='blog-detail'),
    url(r'^img/add/$', BlogPostImageCreate.as_view(), name='image-create'),
]
Ejemplo n.º 5
0
# coding; utf-8
from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from blog.views import BlogList, BlogDetail, PostDetail, PostUpdate, PostCreate, BlogCreate, BlogUpdate

urlpatterns = [
    url(r'^$', BlogList.as_view(), name="blog_list"),
    url(r'^(?P<pk>\d+)/$', BlogDetail.as_view(), name="blog_detail"),
    url(r'^post/(?P<pk>\d+)/$', PostDetail.as_view(), name="post_detail"),
    url(r'^post/update/(?P<pk>\d+)/$',
        login_required(PostUpdate.as_view()),
        name="post_update"),
    url(r'^post/create/$',
        login_required(PostCreate.as_view()),
        name="post_create"),
    url(r'^update/(?P<pk>\d+)/$',
        login_required(BlogUpdate.as_view()),
        name="blog_update"),
    url(r'^create/$', login_required(BlogCreate.as_view()),
        name="blog_create"),
]
Ejemplo n.º 6
0
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static

from blog.views import BlogList
from cart.views import *
from . import views

urlpatterns = [
    # Regular Django Views

    # API views
    url(r'^blog/$', BlogList.as_view()),
    url(r'^blog/(?P<pk>[0-9]+)/$', views.BlogDetail.as_view()),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Ejemplo n.º 7
0
# util imports
from blog.views import UserCreate, BlogList, BlogDetail


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

    # Blog URLs
    path(
        'users/create/',
        UserCreate.as_view(),
        name='sign-up'
    ),
    path(
        'blog/',
        BlogList.as_view(),
        name='blog-list'
    ),
    path(
        'blog/<int:pk>/',
        BlogDetail.as_view(),
        name='blog-detail'
    ),

    # JWT URLs
    path(
        'token/obtain/',
        jwt_views.TokenObtainPairView.as_view(),
        name='token-create'
    ),
    path(
Ejemplo n.º 8
0
from django.conf.urls import *
from django.contrib import admin
import dbindexer

from blog import urls
from blog.views import BlogList

handler500 = 'djangotoolbox.errorviews.server_error'

# django admin
admin.autodiscover()

# search for dbindexes.py in all INSTALLED_APPS and load them
dbindexer.autodiscover()

urlpatterns = patterns('',
    ('^_ah/warmup$', 'djangoappengine.views.warmup'),
    url('^$', BlogList.as_view(template_name='home.html'), name='home'),
    url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'admin/login.html'}),
    url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
    ('^manage/', include(urls)),
    ('^admin/', include(admin.site.urls)),
)
Ejemplo n.º 9
0
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from blog.views import BlogList

urlpatterns = [
            url(r'^$',login_required(BlogList.as_view(template_name='manage.html')), name="list"),
            url(r'^add/$', 'blog.views.add', name="add"),
            url(r'^edit/(?P<pk>[\d]{16,16})/$', 'blog.views.edit', name="edit"),
            url(r'^delete/(?P<pk>[\d]{16,16})/$', 'blog.views.delete', name="delete"),
            url(r'^serve/(?P<pk>[\d]{1,16})/$', 'blog.views.download_handler', name="serve_image"),
            ]
Ejemplo n.º 10
0
from django.views.generic import ListView, DetailView
from blog.models import Lyrics
from blog.views import Lyric, LyricDetail, Poem, PoemDetail, Stories, StoryDetail, BlogList, BlogDetail


from django.contrib import admin
admin.autodiscover()


urlpatterns = patterns('',

    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', 'blog.views.home', name='home'),
    url(r'^about', 'blog.views.about', name='about'),
    url(r'^lyrics/(?P<pk>\d+)$', LyricDetail.as_view(), name='detail'),
    url(r'^lyrics', Lyric.as_view(), name='listing'),
    url(r'^poems/(?P<pk>\d+)$', PoemDetail.as_view(), name="poem_detail"),
    url(r'^poems', Poem.as_view(), name='poem_listing'),
    url(r'^stories/(?P<pk>\d+)$', StoryDetail.as_view(), name="story_detail"),
    url(r'^stories',Stories.as_view(), name="story_list"),
    url(r'^blog/(?P<pk>\d+)$', BlogDetail.as_view(), name="blog_detail"),
    url(r'^blog', BlogList.as_view(), name="blog_list"),
    
    
   
   
  
   


   )
Ejemplo n.º 11
0
"""main URL Configuration

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
from django.conf.urls import url
from django.conf.urls.static import static
from django.conf import settings

from blog.views import BlogList, DetailBlogView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', BlogList.as_view(), name="home"),
    url(r'^blog/(?P<id>[-\w]+)/$', DetailBlogView.as_view(), name='blog'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)