示例#1
0
文件: urls.py 项目: nsktky/blog
from django.contrib import admin
from django.urls import path
from blog.views import TopView, WorkView, BlogView, WorkDetailView, BlogDetailView, AboutView, CategoryListView, CategoryDetailView

urlpatterns = [
    path('', TopView.as_view(), name='top'),
    path('bloglist/', BlogView.as_view(), name='bloglist'),
    path('worklist/', WorkView.as_view(), name='worklist'),
    path('work/<int:pk>/', WorkDetailView.as_view(), name='workdetail'),
    path('blog/<int:pk>/', BlogDetailView.as_view(), name='blogdetail'),
    path('about/', AboutView.as_view(), name='about'),
    path('categories/', CategoryListView.as_view(), name='categorylist'),
    path('category/<str:slug>/',
         CategoryDetailView.as_view(),
         name='categorydetail'),
]
示例#2
0
"""myblog URL Configuration

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
from blog.views import IndexView, TagView,CategoryView,TagDetailView,CategoryDetailView,BlogDetailView
from comment.views import AddCommet
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', IndexView.as_view(), name='index'),
    path('tags/', TagView.as_view(), name='tags'),
    path('category/', CategoryView.as_view(), name='category'),
    path('tags/<tagDetail>', TagDetailView.as_view(), name='tagDetail'),
    path('category/<categoryDetail>', CategoryDetailView.as_view(), name='categoryDetail'),
    path('blog/<blogDetail>', BlogDetailView.as_view(), name='blogDetail'),
    path('add_comment/<add_comment>', AddCommet.as_view(), name='add_comment'),
]
示例#3
0
文件: urls.py 项目: mitrofun/justblog
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import url
from blog.views import IndexView, PostDetailView, CategoryDetailView
from blog.views import PostDayArchiveView, PostMonthArchiveView, \
    PostYearArchiveView


urlpatterns = [
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^(?P<year>\d{4})/'
        r'(?P<month>\d{1,2})/'
        r'(?P<day>\d{1,2})/'
        r'(?P<slug>[-\w]+)/$', view=PostDetailView.as_view(),
        name='detail'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$',
        view=PostDayArchiveView.as_view(), name='day'),
    url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',
        view=PostMonthArchiveView.as_view(), name='month'),
    url(r'^(?P<year>\d{4})/$', view=PostYearArchiveView.as_view(),
        name='year'),
    url(r'^categories/(?P<slug>[-\w]+)/$', view=CategoryDetailView.as_view(),
        name='category'),
]
示例#4
0
文件: urls.py 项目: zdimon/blog
#coding: utf-8
import os
PROJECT_PATH = os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]
from django.conf.urls import patterns, include, url
from blog.views import CategoryDetailView
from blog.views import TopicDetailView, TopicListView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf import settings
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'blog.views.home', name='home'),
    url(r'^blog-category/(?P<pk>\d+)/$', CategoryDetailView.as_view()),
    url(r'^blog-topic/(?P<pk>\d+)/$', TopicDetailView.as_view()),

    url(r'^blog-topic-list/(?P<pk>\d+)/$', TopicListView.as_view(template_name = 'blogtopic_list.html'), name='blog-topic-list'),

    url('^markdown/', include( 'django_markdown.urls')),
    url(r'^elfinder/', include('elfinder.urls')),
    url(r'^ckeditor/', include('ckeditor.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)

from config.settings import DEBUG, MEDIA_ROOT
示例#5
0
文件: urls.py 项目: nonamenix/sandbox
# coding: utf-8
from django.conf.urls import patterns, url
from django.views.generic import ListView
from blog.models import Post, Category

from blog.views import PostsListView, PostDetailView, CategoryDetailView


urlpatterns = patterns(
    '',
    url(r'^$', PostsListView.as_view(), name='list'),
    url(r'^importants/$', ListView.as_view(
        queryset=Post.important_objects.all()[0:5],
        template_name='blog/importants.html',
        context_object_name='posts'
    ), name='importants'),
    url(r'^categories/$', ListView.as_view(
        queryset=Category.objects.all(),
        template_name='blog/categories.html',
        context_object_name='categories'
    ), name='categories'),
    url(r'^category/(?P<slug>[-\w]+)/$', CategoryDetailView.as_view(), name='category'),
    url(r'^(?P<slug>[-\w]+)/$', PostDetailView.as_view(), name='detail'),
)
示例#6
0
文件: urls.py 项目: LordK1/Socialist
from django.conf.urls import url, include
from blog.views import PostListView, PostDetailView, CategoryDetailView, CategoryListView, PostCreateView, \
    CategoryCreateView

__author__ = 'k1'

urlpatterns = [
    url(r'^$', PostListView.as_view(), name='post_list'),
    url(r'^post/(?P<pk>\d+)/$', PostDetailView.as_view(), name='post_detail'),
    url(r'^post/create/$', PostCreateView.as_view(), name='post_create'),
    # url(r'^comments/', include('django.contrib.comments.urls')),
    url(r'^categories/$', CategoryListView.as_view(), name='category_list'),
    url(r'^category/(?P<pk>\d+)/$', CategoryDetailView.as_view(), name='category_detail'),
    url(r'^category/create/$', CategoryCreateView.as_view(), name='category_create'),
]
示例#7
0
from django.conf.urls import patterns, url

from blog.views import EntryDetailView, EntryListView, CategoryDetailView


urlpatterns = patterns('',
                       url(r'^$', EntryListView.as_view(), name='blog.list'),
                       url(r'^post/(?P<slug>[^\.]+)$',
                           EntryDetailView.as_view(), name='blog.post'),
                       url(r'^category/(?P<slug>[^\.]+)$',
                           CategoryDetailView.as_view(), name='blog.category'),
)
示例#8
0
文件: urls.py 项目: azamat1977/blog
                        CategoryCreateView, CategoryDeleteView,
                        CategoryUpdateView, CategoryDetailView, login, logout,
                        register)
from django.views.generic import TemplateView
from django.views.decorators.cache import cache_page

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
    # urls_for_article
    path('article/', article_listview),
    path('article/create/', ArticleCreateView.as_view()),
    path('article/<int:pk>/delete/', ArticleDeleteView.as_view()),
    path('article/<int:pk>/update/', ArticleUpdateView.as_view()),
    path('article/<int:pk>/', ArticleDetailView.as_view()),

    # path('article/post_form/', post_form),

    # urls_for_category
    path('category/', category_listview),
    path('category/create/', CategoryCreateView.as_view()),
    path('category/<int:pk>/delete/', CategoryDeleteView.as_view()),
    path('category/<int:pk>/update/', CategoryUpdateView.as_view()),
    path('category/<int:pk>/', CategoryDetailView.as_view()),

    # urls_for_login_logout
    path('login/', login),
    path('logout/', logout),
    path('register/', register),
]